ASIN: Difference between revisions
Jump to navigation
Jump to search
Example by SMcNeill
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
m (Protected "ASIN" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))) |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
{{PageDescription}} | {{PageDescription}} | ||
* 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. | * 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]]. | ||
{{PageAvailability}} | |||
* '''Version 1.000 and up''' | * '''Version 1.000 and up''' | ||
Line 19: | Line 19: | ||
{{PageExamples}} | {{PageExamples}} | ||
''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}} | ||
{{Cl|DEFDBL}} A-Z | {{Cl|DEFDBL}} A-Z | ||
{{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle | {{Cl|INPUT}} {{Text|<nowiki>"Give me an Angle (in Degrees) => "</nowiki>|#FFB100}}; Angle | ||
{{Cl|PRINT}} | {{Cl|PRINT}} | ||
C = {{Cl|SIN}}({{Cl|_D2R}}(Angle)) '_D2R is the command to convert Degrees to Radians, which is what SIN expects | C = {{Cl|SIN}}({{Cl|_D2R}}(Angle)) {{Text|<nowiki>'_D2R is the command to convert Degrees to Radians, which is what SIN expects</nowiki>|#919191}} | ||
{{Cl|PRINT}} "The SINE of the Angle is: "; C | {{Cl|PRINT}} {{Text|<nowiki>"The SINE of the Angle is: "</nowiki>|#FFB100}}; C | ||
A = {{Cl|_ASIN}}(C) | A = {{Cl|_ASIN}}(C) | ||
{{Cl|PRINT}} "The ASIN of "; C; " is: "; A | {{Cl|PRINT}} {{Text|<nowiki>"The ASIN of "</nowiki>|#FFB100}}; C; {{Text|<nowiki>" is: "</nowiki>|#FFB100}}; A | ||
{{Cl|PRINT}} "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; {{Cl|_R2D}}(A) | {{Cl|PRINT}} {{Text|<nowiki>"Notice, A is the Angle in Radians. If we convert it to degrees, the value is "</nowiki>|#FFB100}}; {{Cl|_R2D}}(A) | ||
{{CodeEnd}} | {{CodeEnd}} | ||
{{ | {{Small|Example by SMcNeill}} | ||
{{OutputStart}} | {{OutputStart}} | ||
Give me an Angle (in Degrees) => ? 60 | Give me an Angle (in Degrees) => ? 60 | ||
Line 41: | Line 41: | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [[_D2G]] {{ | * [[_D2G]] {{Text|(degree to gradient}}, [[_D2R]] {{Text|(degree to radian)}} | ||
* [[_G2D]] {{ | * [[_G2D]] {{Text|(gradient to degree)}}, [[_G2R]] {{Text|(gradient to degree}} | ||
* [[_R2D]] {{ | * [[_R2D]] {{Text|(radian to degree)}}, [[_R2G]] {{Text|(radian to gradient}} | ||
* [[COS]] {{ | * [[COS]] {{Text|(cosine)}}, [[SIN]] {{Text|(sine)}}, [[TAN]] {{Text|(tangent)}} | ||
* [[_ACOS]] {{ | * [[_ACOS]] {{Text|(arc cosine)}}, [[ATN]] {{Text|(arc tangent)}} | ||
* [[_ACOSH]] {{ | * [[_ACOSH]] {{Text|(arc hyperbolic cosine)}}, [[_ASINH]] {{Text|(arc hyperbolic sine)}}, [[_ATANH]] {{Text|(arc hyperbolic tangent)}} | ||
* [[_ATAN2]] {{ | * [[_ATAN2]] {{Text|(Compute arc tangent with two parameters)}} | ||
* [[_HYPOT]] {{ | * [[_HYPOT]] {{Text|(hypotenuse)}} | ||
*[[Mathematical Operations]] | *[[Mathematical Operations]] | ||
*[[ | *[[Mathematical Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 14:10, 19 March 2023
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) |
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
- _D2G (degree to gradient, _D2R (degree to radian)
- _G2D (gradient to degree), _G2R (gradient to degree
- _R2D (radian to degree), _R2G (radian to gradient
- COS (cosine), SIN (sine), TAN (tangent)
- _ACOS (arc cosine), ATN (arc tangent)
- _ACOSH (arc hyperbolic cosine), _ASINH (arc hyperbolic sine), _ATANH (arc hyperbolic tangent)
- _ATAN2 (Compute arc tangent with two parameters)
- _HYPOT (hypotenuse)
- Mathematical Operations
- Derived Mathematical Functions