10 mathematical functions, details, and examples – Campbell Scientific RTDAQ Software User Manual

Page 306

Advertising
background image

Section 10. Utilities

10.3.3.1.10 Mathematical Functions, Details, and Examples

TABLE 10.3-6. Split Operators and Math Functions

OPERATORS

OPERATOR PRECEDENCE ORDER

(3 = high, 1 = low)

^

= raise to the power

3

x Mod y = Modulo divide of x by y

2

∗ /

= multiplication, division

2

+ -

= addition, subtraction

1

EXAMPLES OF SYNTAX FOR MATHEMATICAL OPERATORS

3

∗5

multiply element 3 by element 5

3/5

divide element 3 by element 5

(3..5)/(8..10)

same as 3/8, 4/9, 5/10

3+5

add element 3 to element 5

3-5

subtract element 5 from element 3

(3,9,5)-(8,7,10)

same as 3-8, 9-7, 5-10

3

∗2.0

multiply element 3 by a fixed number 2

2^3.0

raise element 2 to the third power

MATH

FUNCTIONS

Abs(x)

= Absolute value of x

Arctan(x)

= Arc tangent of x (in degrees)

Cos(x)

= Cosine of x (in degrees)

Exp(x)

= Natural Exponent function (e

x

)

Frac(x)

= Fractional portion of x

Int(x)

= Integer portion of x

Ln(x)

= Natural logarithm of x

Sin(x)

= Sine of x (in degrees)

SpaAvg(x..y)

= Spatial average of elements x through y

SpaMax(x..y)

= Spatial maximum of elements x through y

SpaMin(x..y)

= Spatial minimum of elements x through y

SpaSd(x..y)

= Spatial standard deviation of elements x through y

Sqrt(x)

= Square root of x


The following array of ASCII data will be used for all Mathematical function
examples.

0105 0176 1200 -07.89 55.10 12.45 270.5

Abs(x)

returns the absolute, or positive value of element x.
Examples:

Abs(4) = 7.89

Abs(4

∗5) = 434.74

Arctan(x)

returns the arc tangent of element x in degrees.
Examples:

Arctan(7) = 89.788

Arctan(7/6) = 87.365

Cos(x)

returns the cosine of element x in degrees.
Examples:

Cos(5) = .57215

Cos(5-6) = .73551

10-36

Advertising