Asin (source) – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 175

Advertising
background image

Section 8. Processing and Math Instructions

8-3

If bit in And bit in

The result

expr1 is expr2 is is
0

0

0

0

1

0

1

0

0

1

1

1

And Operator Example
The example assigns a value to Msg that depends on the value of variables A,
B, and C, assuming that no variable is a Null. If A = 10, B = 8, and C = 6, both
expressions evaluate True. Because both expressions are True, the And
expression is also True.

Dim A, B, C, Msg

'Declare variables.

A = 10: B = 8: C = 6

'Assign values.

If A > B And B > C Then

'Evaluate expressions.

Msg = True

Else

Msg = False

End If

ASIN (Source)

The ASIN function returns the arc sin of a number.

Syntax
x = ASIN
(source)

Remarks
Source can be any valid numeric expression that has a value between -1 and 1
inclusive.

The ASIN function takes the ratio of two sides of a right triangle and returns
the corresponding angle. The ratio is the length of the side opposite to the
angle divided by the length of the hypotenuse. The result is expressed in
radians and is in the range -

π

/2 to

π

/2 radians.

To convert degrees to radians, multiply degrees by

π

/180. To convert radians

to degrees, multiply radians by 180/

π

.

ASIN is the inverse trigonometric function of Sin, which takes an angle as its
argument and returns the length ratio of the side opposite the angle to the
hypotenuse.

ASIN Function Example
The example uses ASIN to calculate

π

. By definition, a full circle is 2

π

radians.

ASIN(1) is

π

/2 radians (90 degrees).

Public Pi

'Declare variables.

Pi = 2 * ASin( 1 )

'Calculate Pi.

Advertising