Difference between revisions of "ASIN"

From QB64 Wiki
Jump to navigation Jump to search
imported>SMcNeill
(availability added)
imported>SMcNeill
(style guidelines)
Line 1: Line 1:
{{DISPLAYTITLE:_ASIN}}
{{DISPLAYTITLE:_ASIN}}
The '''_ASIN''' function returns the angle measured in radians based on an input [[SIN]]e value ranging from -1 to 1.
The {{KW|_ASIN}} function returns the angle measured in radians based on an input [[SIN]]e value ranging from -1 to 1.




{{PageSyntax}}  
==Syntax==
::::: radian_angle! = _ASIN(''sine_value!'')
: {{Parameter|radian_angle!}} = {{KW|_ASIN}}({{Parameter|sine_value!}})




* The ''sine_value!'' must be measured >= -1 and <= 1, or else it will generate a return value of -1.#IND, which is basically QB64's way of telling us that the number doesn't exist.  
==Description==
* The {{Parameter|sine_value!}} must be measured >= -1 and <= 1, or else it will generate a return value of '''-1.#IND''', which is basically QB64's way of telling us that the number doesn't exist.  
* ARCSINE is the inverse function of [[SIN]]e, and turns a [[SIN]]e value back into an angle.
* ARCSINE is the inverse function of [[SIN]]e, and turns a [[SIN]]e value back into an angle.
* Note: Due to rounding with floating point math, the _ASIN may not always give a perfect match for the SIN angle which generated this. You can reduce the number of rounding errors by increasing the precision of your calculations by using [[DOUBLE]] or [[_FLOAT]] precision variables instead of [[SINGLE]].
* Note: Due to rounding with floating point math, the _ASIN may not always give a perfect match for the SIN angle which generated this. You can reduce the number of rounding errors by increasing the precision of your calculations by using [[DOUBLE]] or [[_FLOAT]] precision variables instead of [[SINGLE]].




''Availability:''
==Availability==
* '''Version 1.000 and up'''
* '''Version 1.000 and up'''




==Examples==
''Example:'' Converting a radian angle to its SINe and using that value to find the angle in degrees again using _ASIN:
''Example:'' Converting a radian angle to its SINe and using that value to find the angle in degrees again using _ASIN:
{{CodeStart}} '' ''
{{CodeStart}} '' ''
Line 38: Line 40:




''See also:''
==See also==
* [[_D2G]] {{text|(degree to gradient}}, [[_D2R]] {{text|(degree to radian)}}
* [[_D2G]] {{text|(degree to gradient}}, [[_D2R]] {{text|(degree to radian)}}
* [[_G2D]] {{text|(gradient to degree)}}, [[_G2R]] {{text|(gradient to degree}}
* [[_G2D]] {{text|(gradient to degree)}}, [[_G2R]] {{text|(gradient to degree}}

Revision as of 00:30, 5 September 2017

The _ASIN function returns the angle measured in radians based on an input SINe value ranging from -1 to 1.


Syntax

radian_angle! = _ASIN(sine_value!)


Description

  • The sine_value! must be measured >= -1 and <= 1, or else it will generate a return value of -1.#IND, which is basically QB64's way of telling us that the number doesn't exist.
  • ARCSINE is the inverse function of SINe, and turns a SINe value back into an angle.
  • Note: Due to rounding with floating point math, the _ASIN may not always give a perfect match for the SIN angle which generated this. You can reduce the number of rounding errors by increasing the precision of your calculations by using DOUBLE or _FLOAT precision variables instead of SINGLE.


Availability

  • Version 1.000 and up


Examples

Example: Converting a radian angle to its SINe and using that value to find the angle in degrees again using _ASIN:

DEFDBL A-Z INPUT "Give me an Angle (in Degrees) => "; Angle PRINT C = SIN(_D2R(Angle)) '_D2R is the command to convert Degrees to Radians, which is what SIN expects PRINT "The SINE of the Angle is: "; C A = _ASIN(C) PRINT "The ASIN of "; C; " is: "; A PRINT "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; _R2D(A)

Example by SMcNeill

Give me an Angle (in Degrees) => ? 60 The SINE of the Angle is: .8660254037844386 The ACOS of .8660254037844386 is: 1.047197551196598 Notice, A is the Angle in Radians. If we convert it to degrees, we discover the value is 60


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page