Been there, but none work in FM...I'm not trig whiz, just want a copy-paste solution.
Great link ! Thx.
I thought this was the developer forum.
Developers help developers... we all can't know everything about everything.
I've deployed many FM solutions and having fun with FM GO. I'm not a math whiz, so unless you can offer some helpful posts...
To translate the math (and non-FileMaker code) into a calculation that will work in FileMaker, try this:
// BearingFinal ( latitude1 ; longitude1 ; latitude2 ; longitude2 )
Let ( [
// reverse order of inputs to get final bearing rather than initial bearing
~latitude1 = Radians ( latitude2 );
~latitude2 = Radians ( latitude1 );
~longitudeDifference = Radians ( longitude1 - longitude2 );
~y = Sin ( ~longitudeDifference ) * Cos ( ~latitude2 );
Cos ( ~latitude1 ) * Sin ( ~latitude2 )
- Sin ( ~latitude1 ) * Cos ( ~latitude2 ) * Cos ( ~longitudeDifference );
~x = 0 and ~y ≥ 0 ; 90; // degrees
~x = 0 /* and ~y < 0 */ ; 270;
/* Else */ Degrees ( Atan ( ~y / ~x ) )
~bearing = // correct ~bearing for quadrant
/* quadrants 2 & 3 */ ~x < 0;
180 + ~bearing;
/* quadrant 4 */ ~y < 0; // and ~x ≥ 0
Mod ( 360 + ~bearing ; 360 );
/* Else, quadrant 1 */
// reverse input, since we're looking for final bearing rather than initial bearing
Mod ( 180 + ~bearing ; 360 )
You are most welcome.