'Mathematical functions demonstration
' this is a DEMO to show some functions of the
' RQ_MATH.INC function library

$apptype CONSOLE
$INCLUDE "RAPIDQ.INC"
$INCLUDE "RQ_MATH.INC"

print "The hyperbolic arccotangent of 4 is: ",ACOTH(4)
print
print "The number PI is: ", rqpi
print
print "The angle 95degr is in radians: ", DEG2RAD(95)
print
print "GDC : ", GCD(15, 60)


'some functions of complex numbers:
'==================================
PRINT
' Addition
DIM Z(4)AS DOUBLE  
Z(0) = 4
Z(1) = 6
Z(2) = 3
Z(3) = -4
Z() = ADDZ(Z())
PRINT "addition of two complex numbers: z1 = 4 + i6 , z2 = 3 - i4 
PRINT "        addition z1 + z2 :  z = ",Z(0)," + i",Z(1)
PRINT 
' Substraction
REDIM Z(4)AS DOUBLE
Z(0) = 10
Z(1) = 6
Z(2) = 3
Z(3) = -4
Z() = SUBZ(Z())
PRINT "substraction of two complex numbers: z1 = 10 + i6 , z2 = 3 - i4 "
PRINT "        substraction z1 - z2 : z = ",Z(0)," + ",Z(1) 
PRINT
'normal form
DIM COMPL(2) AS DOUBLE
' NORZ transforms a complex number to the normal form
COMPL(0) = 3
COMPL(1) = 2
COMPL () = NORZ(COMPL())
PRINT " The complex number is z = 3 + i2. "
PRINT " The 'normal form' is :
PRINT "         absolut value: R = ",COMPL(0)
PRINT "         the argument of z : theta = ",COMPL(1)
PRINT 
PRINT "other functions:"
PRINT "Question :"
PRINT " Is the number 35 odd or even ?"

'other funtions
If ODD(35) = 1 THEn PRINT " 35 is odd !!!"
IF EVEN(35) = 0 THEN PRINT " 35 is not even !!!"
 
 input ende$
