HP Forums
(71B) Easy Traverse Calculation - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (71B) Easy Traverse Calculation (/thread-6461.html)



(71B) Easy Traverse Calculation - Eddie W. Shore - 06-27-2016 03:26 AM

Calculates the new point knowing the original coordinates, direction, and angle of travel. The angle 0° comes from due east and rotates counterclockwise.

Code:
Program TRAVEZ (216 bytes)


15 DEGREES
20 INPUT “INIT. EASTING:”;E
25 INPUT “INIT. NORHTING:”;N
30 D=0
40 INPUT “DISTANCE:”;I
45 INPUT “ANGLE:”;A
50 E=I*COS(A)+E
55 N=I*SIN(A)+N
57 D=D+I
60 DISP N;’,’;E
65 PAUSE
70 INPUT “DONE? (Y=1,N=0)”;X
75 IF X=0 THEN 40
90 DISP “TOTAL DIST:”;D