# finding the coordinate of a point using a distance and an angle from given point

sorry for the simple question and please replay with simple terms

I have two points (A, B) where the A is the center of my plot (xA, yA). I know the distance (AB) between the point A and B and the angle (theta) expressed in degrees (°) respect the North (0°) (i.e., measured by a Compass).

I wish to compute the position (xB, yB) of the point B using the point A (xA, yA) as the center of my system.

• Which direction are your axes? The standard in math is for $\theta=0$ and the $+x$ axes to point to the left with $+y$ up. It works your way, too. It just changes some $\sin$ and $\cos$ around – Ross Millikan Apr 24 '14 at 22:21
• Thanks Ross i have a compass where 0 is the north, 90 the east, 180 the south, and 270 the west. – Gianni Apr 24 '14 at 22:23
• Ok, which way are $+x,+y?$ – Ross Millikan Apr 24 '14 at 22:33

## 1 Answer

With the distance, you have the hypotenuse of a right triangle. You could then use your angle to find the angle opposite point B, then use sin and cos to get the X and Y distances between A and B. Since you've defined A as the centre of the system, you can translate the X and Y distances directly into coordinates of the appropriate sign. If A wasn't in the centre you'd have the offset that B is from A. With that you can find where it is related to the origin.

I recommend drawing a diagram. It's usually very helpful.

EDIT: Alternate approach.

You could take it as though the line AB were extending from the unit circle by multiplying by your distance. Then you'd have $Y_b - Y_a = |AB|\sin{m}$ and $X_b - X_a = |AB|\cos{m}$. However $m$ here is NOT your angle from north. It's your angle from the X axis, counterclockwise. The angle you have is from the Y axis, going clockwise. To translate

$$(360 - \theta) + 90 = 450 - \theta = m$$

You could mod it by 360 if you want, but calculators will generally accept looping around the circle.

• Thanks but could i simply use xb = ABsin(theta) yb = ABcos(theta) where AB is the distance between point A and point B, because i already know the distance AB – Gianni Apr 24 '14 at 21:53
• You are close, but haven't considered the center of the plot. The correct version is $xB=AB\cos(\theta)+xA,yB=AB\sin(\theta)+yA$ but that uses the usual math conventions of axes and angles. – Ross Millikan Apr 24 '14 at 22:24
• I've added an edit for a different approach, though it looks like @RossMillikan added an explanation while I was typing it. – RandomUser Apr 24 '14 at 22:27