Menu

arrgh need help with maths

K.Z.
2008-08-25
2012-09-26
  • K.Z.

    K.Z. - 2008-08-25

    If someone could offer me their mathmatical
    expertise I would be very happy.

    If your 'A' and you need to get to 'B'.
    what is the calculation to get a direct line
    from 'A' to 'B'.Where a and b could be placed
    anywhere on the "board".

    At the moment my line is like this....

    . . . B . . . . .
    . . . * . . . . .
    . . . * . . . . .
    . . . * . . . . .
    . . . . * . . . .
    . . . . . * . . .
    . . . . . . A . .

    I can't think how to get that line to travel
    directly from a to b,some kind of mean to use
    when incrementing x/y is needed.

     
    • cpns

      cpns - 2008-08-25

      Use Bresenham's algorithm for the Cartesian points of a straight line. http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.