Hi

I’m very new to this but am trying to do a small app which calculates a bearing needed to take when starting and ending coordinates are input.

I have a working excel calculation which works but am struggling on how to convert this into an ai2 format.

I’ve got so far but stumbling with a bit of the math involved.

I’ve got the coordinates converted to radians using the inbuilt function which works correctly.

The excel calculation I wish to get into ai2 is as follows:

=MOD(ATAN2((COS(C3)*SIN(C6))-(SIN(C3)*COS(C6)*COS(C7-C4)), SIN(C7-C4)*COS(C6)),2*PI())*180/PI()

Here’s what I’ve got up to and think I’m very close.

Any help much appreciated