I figured this one would be easy and I would just need to refresh my memory of basic trig to sort it out but it has turned out to be trickier than I expected.
I want to draw a line between two random points and then have little perpendicular lines, evenly spaced along its length. So it will look sort of like a row of stitches or a zipper.
So, if I have the x1,y1,x2,y2 of the main line and use a for loop to do the x1,y1 of the 'railroad ties'', what formula can I use to get the x2,y2 of those so that they are properly perpendicular to the main line?
Any suggestions would be appreciated. My toddler is really into trains and the idea is to make a little train track then have a couple of rectangles going up and down and then mess about with that in some way.
1