26 lines
914 B
Plaintext
26 lines
914 B
Plaintext
void local fn GetDifference( b1 as float, b2 as float )
|
|
float r = ( b2 - b1 ) mod 360.0
|
|
if r >= 180.0 then r = r - 360.0
|
|
printf @"%9.1f\u00B0 %10.1f\u00B0 = %7.1f\u00B0", b1, b2, r
|
|
end fn
|
|
|
|
printf @"Input in -180 to +180 range:"
|
|
printf @"-----------------------------------"
|
|
printf @"%9s %12s %15s", "b1", "b2", "distance"
|
|
printf @"-----------------------------------"
|
|
fn GetDifference( 20.0, 45.0 )
|
|
fn GetDifference( -45.0, 45.0 )
|
|
fn GetDifference( -85.0, 90.0 )
|
|
fn GetDifference( -95.0, 90.0 )
|
|
fn GetDifference( -45.0, 125.0 )
|
|
fn GetDifference( -45.0, 145.0 )
|
|
fn GetDifference( -45.0, 125.0 )
|
|
fn GetDifference( -45.0, 145.0 )
|
|
fn GetDifference( 29.4803, -88.6381 )
|
|
fn GetDifference( -78.3251, -159.036 )
|
|
fn GetDifference( -70099.74233810938, 29840.67437876723 )
|
|
fn GetDifference( -165313.6666297357, 33693.9894517456 )
|
|
fn GetDifference( 1174.8380510598456, -154146.66490124757 )
|
|
|
|
HandleEvents
|