Hi,
I am trying to take an point and move it along a line. In more detail, let’s say I have the following locations on my screen: point A: (1,1) and then point B (4,4). I want to move from A to B. Let’s say that during each movement, it will move X, where X is a whole number such as 2. So the angle is around 45 degrees, and I want to move on this. I am trying to develop the method to calculate this movement.
My initial thought is to move X (2 units) along a straight line, say (1,1) to (1, 4), then rotate it by the angle: 45 degrees. This would then plot the correct point on the path.
So something of this nature:
1.) Get the distance on the Y plane, in this case 2: (1,3).
2.) Rotate by the angle, in this case 45 degrees.
3.) Save the new point.
Repeat until at the spot.
Would this work? What would happen if the location does not fit directly on a solid number, ie: (1.5, 3), would that cause any unforeseen problems with using say, contains or a transform with affinetransform?
Thanks!