CM/XP version OPL
Although the Psion team included the normal set of Trig Functions SIN(), COS(), and TAN() they only included one inverse function ATAN().. Also as we in the UK generally like to work in Degrees rather than Radian or Gradians; the following snippets will work as a replacement..
Code: Select all
ASIN:(x)
RETURN DEG(ATAN((x/(SQR(1-x**2)))))
ACOS:(x)
RETURN DEG((ATAN((SQR(1-x**2))/x)))
ATAN:(x)
RETURN DEG(ATAN(x))
Code: Select all
DEG:(x)
RETURN DEG(RAD(x))
SIN:(x)
RETURN SIN(RAD(x))
COS:(x)
RETURN COS(RAD(x))
TAN:(x)
RETURN TAN(RAD(x))
Code: Select all
DMS:(Dd)
LOCAL g%,d,m,s
d=INT(Dd)
m=INT((Dd-d)*60)
s=INT((((Dd-d)*60)-m)*60)
AT 1,2 :PRINT " ";
AT 1,2 :PRINT "Angle ";d;CHR$(223);m;CHR$(39);s;CHR$(34)
g%=GET
RETURN g% :REM Return KEY press for use in calling routine
DMS:(ATAN:(190/220))
Post below if you try it!
In good faith
Martin