Skip to main content

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)))?

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


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!


Reply