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?

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

1 Answer 1


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 ;-)

  • $\begingroup$ 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? $\endgroup$
    – Dave
    Jul 5, 2013 at 14:04
  • $\begingroup$ @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)$. $\endgroup$
    – dtldarek
    Jul 5, 2013 at 14:08
  • $\begingroup$ Hmm, so If I change the origin, I only have to the value of C? $\endgroup$
    – Dave
    Jul 5, 2013 at 14:13
  • $\begingroup$ $\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). $\endgroup$
    – dtldarek
    Jul 5, 2013 at 14:15
  • $\begingroup$ 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. $\endgroup$
    – Dave
    Jul 5, 2013 at 14:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .