Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

$ZARCTAN

逆 (アーク) タンジェント関数です。

Synopsis

$ZARCTAN(n)

パラメータ

n 任意の正や負の数字

概要

$ZARCTAN は、n の三角関数の逆 (アーク) タンジェントを返します。結果は、1.57079 (pi の半分) から 0、0 から -1.57079 です。結果はラジアンで返されます。

パラメータ

n

任意の正や負の数字です。値、変数、式として指定することができます。$ZPI 特殊変数を使用して、pi を指定することができます。非数値文字列は 0 として評価されます。

以下は、$ZARCTAN によって返されるアーク・タンジェント値です。

2 これは、1.107148717794090502 を返します。
1 これは、.7853981633974483098 を返します。
0 これは、0 を返します。
-1 これは、-.7853981633974483098 を返します。

以下は、数のアーク・タンジェントの計算を許可する例です。

   READ "Input a number: ",num
   WRITE !,"the arc tangent is: ",$ZARCTAN(num)
   QUIT

以下の例は、Caché 小数 ($DECIMAL の数値) の結果と $DOUBLE の数値の結果を比較します。どちらの場合も、pi/2 のアーク・タンジェントは 1 ではない小数値ですが、0 のアーク・タンジェントは 0 です。

  WRITE !,"the arc tangent is: ",$ZARCTAN(0.0)
  WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE(0.0))
  WRITE !,"the arc tangent is: ",$ZARCTAN($ZPI)
  WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE($ZPI))
  WRITE !,"the arc tangent is: ",$ZARCTAN($ZPI/2)
  WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE($ZPI)/2)

関連項目

FeedbackOpens in a new tab