Skip to main content
Question

How to Calculate Angle in Degrees From North

  • Apr 28, 2013 11:05 PM UTC
  • 3 replies
  • 381 views

Forum|alt.badge.img
I am currently using the NeighborFinder to calculate the distance and direction between two points.

 

 

However, angle (direction) is calculated from the x-axis, counter clockwise. Is there an easy way for me to calculate the angle from the y-axis (ie north) clockwise? 

 

 

Otherwise, I may be stuck doing some fuzzy math to rotate and flip the numbers!

 

 

Thanks in advance for any help.

 

 

 

Mattt
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

takashi
Celebrity
  • Apr 29, 2013 2:57 AM UTC
Hi Matt again :-)   Try these formulas: t = 90 - s (0 <= s < 90) t = 360 - (s - 90) = 450 - s (90 <= s < 360) s: counter clockwise angle(degree) from x-axis t: clockwise angle(degree) from y-axis   Which formula should be applied depends on the value of the original angle i.e. counter clockwise from x-axis.

 

If you are using FME 2013 SP1, an AttributeCreator with 'Conditional Value' setting would be efficient. If not, test whether the original angle is less than 90 or not, then use 2 AttributeCreators (or ExpressionEvaluators) for each formula separately.

 

  Takashi

Forum|alt.badge.img
That's basically what I came up with. Was just posting this question in case I was missing something blatantly obvious.

 

 

Yet again, thanks for your assistance!!

 

 

 

Matt

jlmiserez
Contributor
Forum|alt.badge.img
  • Contributor
  • Apr 29, 2013 12:30 PM UTC
Hi Matt,

 

You should consider using the AzimtuhCalculator.

 

 

http://fmestore.safe.com/transformers/AzimuthCalculator.htm