Angle difference between two bearings: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
|||
Line 2,105: | Line 2,105: | ||
</pre> |
</pre> |
||
=={{header|Craft Basic}}== |
|||
<syntaxhighlight lang="basic">input "angle 1:", a1 |
|||
input "angle 2:", a2 |
|||
let b = (a2 - a1) % 360 |
|||
if b > 180 then |
|||
let b = b - 360 |
|||
endif |
|||
if b < -180 then |
|||
let b = b + 360 |
|||
endif |
|||
print "difference: ", b |
|||
end</syntaxhighlight> |
|||
=={{header|D}}== |
=={{header|D}}== |