# Trigonometric Functions

### ARCTAN
COS
COSWAVE
SIN
SINWAVE
TAN

Trigonometric Builtins perform basic trigonometric calculations. The trigonometric functions can be useful in modeling scientific problems (for example, kinematics in two or three dimensions). They also can be helpful if you wish to drive an input to the model using a periodically fluctuating signal (e.g., sine or cosine wave).

#####
ARCTAN(<expression>)

The ARCTAN function gives the arctangent of expression. The arctangent is the angle in radians whose tangent is expression. The angle will be in the range -pi/2 to pi/2. To convert measurement between degrees and radians, use the identity:

pi (radians) = 180 (degrees). Expression can be constant or variable.

Examples:

ARCTAN(1) equals 0.785 (p/4 radians)

ARCTAN(1)*180/PI equals 45 (degrees)

#####
COS(<radians>)

The COS function gives the cosine of radians, where radians is an angle in radians. To convert measurement between degrees and radians, use the identity: pi (radians) = 180 (degrees). Radians can be constant or variable.

Examples:

COS(1.047) equals 0.5

COS(60*(PI/180)) equals 0.5

#####
COSWAVE(<amplitude>,<period>)

The COSWAVE function returns a time-dependent cosine wave, with the specified amplitude and period. To generate the cosine wave, the COSWAVE function will use the absolute value of the amplitude you specify. To produce meaningful wave results, choose a DT that is significantly smaller than the period of the wave. A DT equal to a quarter of period gives triangle waves. A smaller DT gives results which better approximate a continuous curve.

Examples:

COSWAVE(10,5) generates a cosine wave with an amplitude of 10 unit and a period of 5 time units.

COSWAVE(-5,2) generates a cosine wave with an amplitude of 5 units and a period of 2 time units.

#####
SIN(<radians>)

The SIN function gives the sine of radians, where radians is an angle in radians. To convert measurement between degrees and radians, use the identity: pi (radians) = 180 (degrees). Radians can be constant or variable.

Examples:

SIN(1.047) equals 0.866

SIN(60*PI/180) equals 0.866

sin_wave = 10*SIN(2*PI*TIME/12) generates a sinusoidal fluctuation with an amplitude of 10 and a period of 12, as shown in Figure 7-4.

Figure 7-4 Sine Wave With Amplitude of 10 and Period of 12

#####
SINWAVE(<amplitude>,<period>)

The SINWAVE function returns a time-dependent sine wave, with the specified amplitude and period. The SINWAVE function will use the absolute value of the amplitude you specify to generate the sine wave. To produce meaningful wave results, choose a DT that is significantly smaller than the period of the wave. A DT equal to a quarter of the period gives triangle waves. A smaller DT gives results which better approximate a continuous curve.

Examples:

SINWAVE(10,5) generates a sine wave with an amplitude of 10 units and a period of 5 time units.

SINWAVE(-5,2) generates a sine wave with an amplitude of 5 units and a period of 2 time units.

#####
TAN(<radians>)

The TAN function gives the tangent of radians, where radians is an angle in radians. To convert measurement between degrees and radians, use the identity: pi (radians) = 180 (degrees). Radians can be constant or variable.

Examples:

TAN(0.785) equals 1

TAN(45*PI/180) equals 1