Trig Functions
Posted: Fri Feb 07, 2025 8:48 pm
While reminiscing elsewhere about surveying solutions on an Organiser II reminds me..
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..
And including LZ OPL...
If we need the calculated angle to de displayed in Deg,Min,sec we can use..
Try this... The pitch of a domestic staircase, which you must prove to the the Building Inspector is less that the maximum allowed in the Building Regulations of 42 degrees, that has a tread going of 220mm and a rise of 190mm is... (TAN=Opp/Adj)
DMS:(ATAN:(190/220))
Post below if you try it!
In good faith
Martin
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