Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

SIN

Returns the sine of an angle.

Synopsis

SIN(number)

Arguments

number An expression that resolves to a number that expresses an angle in degrees.

Description

The SIN function takes an angle in degrees and returns the ratio of two sides of a right triangle. The ratio is the length of the side opposite the angle divided by the length of the hypotenuse, a value in the range -1 to 1 (inclusive).

To return results in radians, set $OPTIONS RADIANS.

To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.

Examples

The following example uses the SIN function to return the sine of an angle:

DIM MyAngle
MyAngle = 1.3;       ! Define angle in degrees.
PRINT SIN(MyAngle);  ! Return sine in radians.

The following example uses the SIN function to return the cosecant of an angle:

DIM MyAngle, MyCosecant
MyAngle = 1.3;                  ! Define angle in degrees.
MyCosecant = 1 / SIN(MyAngle);  ! Calculate cosecant.
PRINT MyCosecant

See Also

Feedback