Caché ObjectScript Reference
[Home] [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 Caché 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

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA