Skip to main content
Question

How to Calculate Angle in Degrees From North

  • April 28, 2013
  • 3 replies
  • 292 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
  • April 29, 2013
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
  • April 29, 2013
Hi Matt,

 

You should consider using the AzimtuhCalculator.

 

 

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