ASN()

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

This function returns the arc sine of the given number or expression.
The result is expressed in radians.
The opposite is the SIN() function.

Syntax

  1. ASN(Number)

Hints

ASN(Number) defined only for -1<=Number<=1 (otherwise, you'll get "out of range" error).
Most mathematical operations in Just BASIC can be performed on Literal Numbers, Numeric Variables, or Numeric Expressions that consist of Literal Numbers, Numeric Variables, or both.
There are 2 * pi radians in a full circle of 360 degrees. A formula to convert degrees to radians is: radians = degrees divided by 57.29577951.

Example

Print ASN(1)
Print ASN(0.5)
Print ASN(-0.2)
Print ASN(-1/2)
End

Useful Procedures

Calculate PI

Function pi()
    'return the value of PI
    pi = Asn(1) * 2
End Function

Radians to Degrees

Function rad2deg(num)
    'returns the given radians as degrees
    rad2deg = 90 / Asn(1) * num
End Function

Degrees to Radians

Function deg2rad(num)
    'returns the given degrees as radians
    deg2rad = Asn(1) / 90 * num
End Function