beautypg.com

B&B Electronics VFG3000 - Manual User Manual

Page 227

background image

F

UNCTION

R

EFERENCE

ATAN

2(

A

,

B

)

R

EVISION

1

P

AGE

211

ATAN

2

(

A

,

B

)

A

RGUMENT

T

YPE

D

ESCRIPTION

a

float

The value of the side that is opposite the angle theta.

b

float

The value of the side that is adjacent to the angle theta

D

ESCRIPTION

This function is equivalent to

atan(a/b)

, except that it also considers the sign of

a

and

b

,

and thereby ensures that the return value is in the appropriate quadrant. It is also capable of
handling a zero value for

b

, thereby avoiding the infinity that would result if the single-

argument form of

tan

were used instead.

F

UNCTION

T

YPE

This function is passive.

R

ETURN

T

YPE

float

.

E

XAMPLE

theta := atan2(1,1)