Campbell CR800 Specifikace Strana 207

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 324
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 206
Section 8. Processing and Math Instructions
Atn FunctionExample
The example uses Atn to calculate π. By definition, a full circle is 2π radians.
Atn(1) is π/4 radians (45 degrees).
Dim Pi 'Declare variables.
Pi = 4 * Atn(1) 'Calculate Pi.
ATN2()
The ATN2 function returns the arctangent of y/x.
Syntax
x = ATN2 ( Y, X )
Remarks
ATN2 function calculates the arctangent of Y/X returning a value in the range
from Pi to -Pi radians, using the signs of both parameters to determine the
quadrant of the return value. ATN2 is defined for every point other than the
origin (X = 0 and Y = 0). Y and X can be variables, constants, or expressions.
To convert degrees to radians, multiply degrees by π/180. To convert radians
to degrees, multiply radians by 180/π.
Pi/2
-Pi/2
Pi
0
+y
+x
-x
-y
ATN2 is the inverse trigonometric function of TAN, which takes an angle as
its argument and returns the ratio of two sides of a right triangle. Do not
confuse ATN2 with the cotangent, which is the simple inverse of a tangent
(1/tangent).
ATN2 Function Example
The example uses ATN2 to calculate π. By definition, a full circle is 2π
radians. ATN2(1,1) is π/4 radians (45 degrees).
Dim Pi 'Declare variables.
Pi = 4 * ATN2( 5, 5 ) 'Calculate Pi.
8-5
Zobrazit stránku 206
1 2 ... 202 203 204 205 206 207 208 209 210 211 212 ... 323 324

Komentáře k této Příručce

Žádné komentáře