Rockwell Automation 5370-CVIM2 Module User Manual

Page 360

Advertising
background image

Chapter 7

Inspection Tools

7–122

atan –– The “

atan

” (arc tangent) function calculates the arc tangent (angle)

on the basis of the tangent value that you enter after the opening parenthesis.
Thus, if you enter

atan(.5)

as a standalone formula, and then pick the

Nominal

field in the tool edit panel,

26.565

(the arc tangent of 0.500) will

appear in the

Nominal

field. Similarly, if you enter

atan(–.5)

,

–26.565

will

appear.

Note that the acceptable range of arc tangent values is 0.0 to

1.

atan2 –– The “

atan2

” (arc tangent “2”) function calculates the arc tangent

(angle) on the basis of entering positive and negative Y–axis and X–axis
values after the opening parenthesis. It takes the form “

atan2(y,x)

,” where y

is the Y–axis value and x is the X–axis value.

The unique aspect of the

atan2

function is its ability to identify the quadrant

in which an angle is located. It makes this distinction on the basis of the signs
of the Y–axis and X–axis values. Thus, if you enter

atan2(20,20)

as a

standalone formula, and then pick the

Nominal

field in the tool edit panel,

45.000

° (the arc tangent of 20 B 20 or 1.000) will appear in the

Nominal

field.

Similarly,

atan2(–20,20)

yields

–45.000

°,

atan2(–20,–20)

yields

–135.000

°, and

atan2(20,–20)

yields

135.000

°. Thus, while each tangent

value (that is, y

B x) in each of these examples is "1.000, the four possible

combinations of the signs of x and y enables the

atan2

function to determine

the specific quadrant in which the angle is located.

In the CVIM2 image coordinate system, which is shown in Figure 7.96 (page
7–123), the angles are derived as indicated on the basis of the signs of x and y.

Advertising