Tan(source), Tanh (source) – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 327

Section 8. Processing and Math Instructions
Tan(Source)
TAN returns the tangent of an angle.
Syntax
TAN(source)
Remarks
The argument source can be any valid numeric expression measured in radians.
Tan takes an angle and returns the ratio of two sides of a right triangle. The ratio is
the length of the side opposite an angle divided by the length of the side adjacent to
the angle.
If it is desired to use degrees instead of radians for the inputs and
results of the trig functions in a program, the "AngleDegrees" declaration
instruction can be used.
To convert degrees to radians, multiply degrees by
π
/180. To convert radians to
degrees, multiply radians by 180/
π
.
π
is approximately 3.141593.
TAN Function Example
The example uses TAN to calculate the tangent of an angle from a Volt(1) input.
Dim Degrees, Pi, Radians, Ans
'Declare variables.
Pi = 4 * Atn(1)
'Calculate
π
.
Degrees = Volt(1)
'Get user input.
Radians = Degrees * (Pi / 180)
'Convert to radians.
Ans =
TAN
(Radians)
‘The Tangent of Degrees.
TANH (Source)
The TANH function returns the hyperbolic tangent of an expression or value.
Syntax
x = TANH (Source)
Remarks
The TANH function returns the hyperbolic tangent [ tanh(x) = sinh(x)/cosh(h) ]
for the value defined in Source.
TANH Function Example
The example uses TANH to calculate the hyperbolic tangent of a voltage input.
Public Volt1, Ans
'Declare variables.
VoltDiff(Volt1,1,mV5000,1,True,100,500,1,0)
'Returns voltage on Channel(1) to Volt(1)
Ans =
TANH
( Volt1 )
'The Hyperbolic Tangent of Volt1.
8-41