# Calculate third point from 2 points and an angle

### Calculate third point from 2 points and an angle

I'm having a hard time putting together a formula. I have 2 points (x0, y0) and (x1, y1) and an angle (k).
Using this information I need to calculate a third point that is k degrees from the previous 2 points.
The problem is something like this: problema_code.jpg (51.77 KiB) Viewed 341 times

Is it possible to do that? Thank you for your attention.
GameVSL

Posts: 1
Joined: Wed Feb 28, 2018 9:09 am
Reputation: 0

### Re: Calculate third point from 2 points and an angle

Yes, it is possible.

Assuming the vector length is the same, you could define the first point as the origin (0,0).
Then describe the first vector in polar coordinates, (r, $$\theta$$), where $$r = \sqrt{x_{1 }^{2} + y_{1 }^{2}}$$ and $$\theta$$ = $$arctan(y_{1 }/x_{1 })$$.

Then create the second vector by adding k degrees to $$\theta$$: $$\theta_{2 }$$ = $$\theta$$ + k
Then convert from polar coordinates back to rectangular coordinates--if you need them that way:

$$x_{2 } = r cos(\theta_{2 })$$ and
$$y_{2 } = r sin(\theta_{2 })$$

rmiller2015

Posts: 6
Joined: Mon Aug 31, 2015 5:57 pm
Reputation: 2