1
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$ – Ross Millikan Apr 24 '14 at 22:21
  • $\begingroup$ Thanks Ross i have a compass where 0 is the north, 90 the east, 180 the south, and 270 the west. $\endgroup$ – Gianni Apr 24 '14 at 22:23
  • $\begingroup$ Ok, which way are $+x,+y?$ $\endgroup$ – Ross Millikan Apr 24 '14 at 22:33
1
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$ – Gianni Apr 24 '14 at 21:53
  • 2
    $\begingroup$ 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. $\endgroup$ – Ross Millikan Apr 24 '14 at 22:24
  • $\begingroup$ I've added an edit for a different approach, though it looks like @RossMillikan added an explanation while I was typing it. $\endgroup$ – RandomUser Apr 24 '14 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.