Home  /  Application Development: Core Topics  /  ObjectScript Reference  /  ObjectScript Functions  /  $ZARCSIN

ObjectScript Reference
[Back]  [Next] 
InterSystems: The power behind what matters   

Inverse (arc) sine function.
n A signed decimal number.
$ZARCSIN returns the trigonometric inverse (arc) sine of n. The result is given in radians.
Signed decimal number ranging from 1 to -1 (inclusive). It can be specified as a value, a variable, or an expression. Numbers outside the range generate an <ILLEGAL VALUE> error. A non-numeric string is evaluated as 0.
The following are arc sine values returned by $ZARCSIN:
1 returns 1.570796326794896619
0 returns 0
-1 returns -1.570796326794896619
The following example permits you to compare the arc sine and the arc cosine of a number:
   READ "Input a number: ",num
   IF num>1 { WRITE !,"ILLEGAL VALUE: number too big" }
   ELSEIF num<-1 { WRITE !,"ILLEGAL VALUE: number too small" }
   ELSE { 
         WRITE !,"the arc sine is: ",$ZARCSIN(num)
         WRITE !,"the arc cosine is: ",$ZARCCOS(num)
The following example compares the results from InterSystems IRIS fractional numbers ($DECIMAL numbers) and $DOUBLE numbers. In both cases, the arc sine of 0 is exactly 0:
  WRITE !,"the arc sine is: ",$ZARCSIN(0.0)
  WRITE !,"the arc sine is: ",$ZARCSIN($DOUBLE(0.0))
  WRITE !,"the arc sine is: ",$ZARCSIN(1.0)
  WRITE !,"the arc sine is: ",$ZARCSIN($DOUBLE(1.0))
  WRITE !,"the arc sine is: ",$ZARCSIN(-1.0)
  WRITE !,"the arc sine is: ",$ZARCSIN($DOUBLE(-1.0))
See Also