qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
TAN Function Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
TAN Function Programming Example
 
The following example computes the height of an object using the distance
from the object and the angle of elevation. The program draws the triangle
produced by the base and the computed height.
 
SCREEN 2
 
INPUT "LENGTH OF BASE: ",Baselen
INPUT "ANGLE OF ELEVATION (DEGREES,MINUTES): ",Deg,Min
 
Ang = (3.141593/180)*(Deg + Min/60)   'Convert to radians.
Height = Baselen*TAN(Ang)             'Calculate height.
PRINT "HEIGHT =" Height
H = 180 - Height
B = 15 + Baselen
 
LINE (15,180)-(B,180):LINE -(B,H)     'Draw triangle.
LINE -(10,180)
LOCATE 24,1 : PRINT "Press any key to continue...";
DO
LOOP WHILE INKEY$=""