HTBasic Help
×
Menu
Index

ARG

Returns the Argument (Angle) of a complex number.
 
 ARG( numeric-expression )
 
Usage:
PRINT "Angle = ";ARG(CMPLX(1,2))
 
Example:      ARG.BAS
 
Description:
The Argument of a complex number is the angle in the complex plane between the positive real axis and a vector to the complex number. Positive angles are counter-clockwise from the positive real axis. ARG returns the principal value which has a range of -PI to PI radians or -180 to 180 degrees, depending on the current trigonometric mode. Note that the ARG of a real number can be either 0 or PI (180), depending on whether the number is positive or negative. COMPLEX numbers are stored in rectangular form, but may be used in polar form using ABS and ARG. For example:
 
PRINT "Magnitude = ";ABS(Z),"Angle = ";ARG(Z)
 
To enter a number in polar form, convert it from polar form to rectangular in this manner:
 
INPUT Magnitude,Angle
Z=CMPLX( Magnitude*COS(Angle), Magnitude*SIN(Angle))
 
See Also: