JM CS2,


Can you try and rephrase... I'm not sure what you mean.. is it 'all 
the pixels that a certain line touches'?

If so, you can get the equation for a line by these junior high maths:
y = kx + m

(
You know the start- and end-points of the line, so:
starty = k * startx + m
endy = k * endx + m

thus:
starty - k * startx = m
endy - k * endx = m

and:
starty - k * startx = endy - k * endx
)

so that:
(starty - endy) / (endx + startx) = k

When you have k you get m by inserting it in the original starty = k 
* startx + m. Now you have the equation for the line.

Make arepeat loop to insert all x:es from startx to endx to see what 
y values you get. Those are the points that the line crosses.


-Andreas



>Dear List
>
>how does one calculate all the points on a straight line vector ?
>
>Thank you and kind regards
>
>JM
>CS2
>
>
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
>email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to