Skip to main content
Question

AzimuthCalculator

  • December 10, 2015
  • 2 replies
  • 39 views

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

The AzimuthCalculator custom transformer uses 6 transformers to calculate the angle (acos((&acX2-;&acX1;)/sqrt(pow((&acY2-;&acY1;),2) + pow((&acX2-;&acX1;),2)))* (180/3.1415926535897932), and normalize it, and then tests which quadrant it's in and so as to calculate the azimuth as either 90-angle or 450-angle.

Is there any reason not to simply use 90-@radToDeg(@atan2(@Value(_!y1)-@Value(_!y0),@Value(_!x1)-@Value(_!x0)))?

2 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 10, 2015

@jdh I tried this and it appears to do exactly what needs to be calculated.


roland.martin
Forum|alt.badge.img+9

The file history here says it originally dates back to 2005. I don't remember offhand whether syntax as complex as your second one was actually possible back then, but even if it was, I suspect it was a lot easier to use separate transformers!

If your calculation works, I'd stick with that instead!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings