Skip to main content
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
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
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
Hi Matt,

 

You should consider using the AzimtuhCalculator.

 

 

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

Reply