; ATan Example ; ------------ ; ATan is the inverse of Tan: given a slope, it returns the matching ; angle in DEGREES, between -90 and +90. ; A ramp that rises 3 units over a run of 4 units: rise#=3 run#=4 Print "A ramp rising "+rise+" over a run of "+run Print "Slope = rise/run = "+(rise/run) Print "Angle = ATan(slope) = "+ATan(rise/run)+" degrees" Print "" ; Steeper slopes give angles nearer 90, shallow ones nearer 0 Print "ATan(0) = "+ATan(0) Print "ATan(0.5) = "+ATan(0.5) Print "ATan(1) = "+ATan(1) Print "ATan(2) = "+ATan(2) Print "ATan(10) = "+ATan(10) Print "ATan(1000) = "+ATan(1000)+" (never quite reaches 90)" Print "ATan(-1) = "+ATan(-1)+" (negative slopes give negative angles)" Print "" Print "ATan alone cannot tell direction over a full circle - see ATan2." Print "" Print "Press any key to close the example" WaitKey End