Move Point A along a line

Sorry, can't post images if my rep is below 10, and can't post more than 2 links. I removed the http section so it won't count as a link. I hope this isn't against forum rules, I'm not hurting anyone.

I checked other questions, like this one (A line moving along the hypotenuse of a right triangle) but the answer was too complicated for me to understand. If someone can explain it again, can you please do it in simpler terms?

• how far do you have to move the point along the line segment? is it a fixed percentage or something? Jul 5, 2013 at 13:52
• It's a decimal. It changes depending on the situation.
– Dave
Jul 5, 2013 at 14:01

Assuming that $C$ is the origin, try $P = d\cdot(\cos(\angle A),\sin(\angle A)) + (A-C)$ where $d$ is the length you need to move your point from point $A$, or try $P = (-d')\cdot(\cos(\angle A),\sin(\angle A)) + (B-C)$ where $d'$ is the length from point $B$.

In fact you could have skipped the trigonometry thing, just set $k = \frac{d}{\mathrm{Length}(AB)}$ or $k' = \frac{d'}{\mathrm{Length}(AB)}$ and calculate $$P = k\cdot B + (1-k)\cdot A$$ or $$P = k'\cdot A + (1-k')\cdot B.$$

I hope this helps ;-)

• I'm sorry, I'm not too good with math. B - C is getting the difference of the points? And the comma between cosA and sinA, what is that? I'm guessing cosA is like X and sinA is like Y and you add it to the difference of the points B and C? I have no idea what the upside down Y is. Is this college level geometry?
– Dave
Jul 5, 2013 at 14:04
• @user2544245 It's just a different notation. If $P.x = 5$and $P.y = 123$, then I write $P = (5,123)$. Simirarly $(\cos \alpha, \sin \alpha)$ is just some point (without a name) of coordinates $x = \cos\alpha$ and $y = \sin\alpha$, finally $d\cdot(x,y) = (d\cdot x, d\cdot y)$. Jul 5, 2013 at 14:08
• Hmm, so If I change the origin, I only have to the value of C?
– Dave
Jul 5, 2013 at 14:13
• $\lambda$ is the Greek letter lambda, it's 'l', like $\alpha$ is 'a' and $\beta$ is 'b'; it does not mean anything in particular. I suggest the second approach, then you can have your origin anywhere you want (and no angle calculations). Jul 5, 2013 at 14:15
• Following the second formula, to get lambda, I need to divide distance by absolute value of point A times point B. Point A times Point B would return (0,0), since each have 0 for one dimension.
– Dave
Jul 5, 2013 at 14:19