Angle difference between two bearings: Difference between revisions
Content added Content deleted
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
No edit summary |
||
Line 2,639: | Line 2,639: | ||
1174.8380510598461 -154146.6649012475973 -161.5029523074336 |
1174.8380510598461 -154146.6649012475973 -161.5029523074336 |
||
60175.7730679554588 42213.0719235437282 37.2988555882694</pre> |
60175.7730679554588 42213.0719235437282 37.2988555882694</pre> |
||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
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 |
|||
</syntaxhighlight> |
|||
{{output}} |
|||
<pre> |
|||
Input in -180 to +180 range: |
|||
----------------------------------- |
|||
b1 b2 distance |
|||
----------------------------------- |
|||
20.0° 45.0° = 25.0° |
|||
-45.0° 45.0° = 90.0° |
|||
-85.0° 90.0° = 175.0° |
|||
-95.0° 90.0° = -175.0° |
|||
-45.0° 125.0° = 170.0° |
|||
-45.0° 145.0° = -170.0° |
|||
-45.0° 125.0° = 170.0° |
|||
-45.0° 145.0° = -170.0° |
|||
29.5° -88.6° = -118.1° |
|||
-78.3° -159.0° = -80.7° |
|||
-70099.7° 29840.7° = -139.6° |
|||
-165313.7° 33694.0° = -72.3° |
|||
1174.8° -154146.7° = -161.5° |
|||
</pre> |
|||
=={{header|Go}}== |
=={{header|Go}}== |