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?

Cos

角度のコサインを返します。

Synopsis

Cos(number)

引数

引数 number は、角度をラジアンで表す任意の有効な数値式です。

概要

Cos 関数は角度を取得し、直角三角形の 2 辺の比を返します。その比は、指定した角に隣接する辺の長さを斜辺の長さで除算した値です。結果は、-1 から 1 の範囲の値になります。

角度をラジアンに変換するには、角度の値に pi/180 を乗算します。ラジアンを角度に変換するには、180/pi を乗算します。

以下の例は、Cos 関数を使用して、角度のコサインを返します。

Dim MyAngle
MyAngle = 1.3           ' Define angle in radians.
Println Cos(MyAngle)    ' Calculate cosine.

以下の例は、Cos 関数を使用して、角度のセカントを返します。

Dim MyAngle, MySecant
MyAngle = 1.3                ' Define angle in radians.
MySecant = 1 / Cos(MyAngle)  ' Calculate secant.
Println MySecant

関連項目

FeedbackOpens in a new tab