Horizontal sundial calculations: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: whitespace |
|||
Line 668:
=={{header|REXX}}==
REXX doesn't have the usual trig functions, nor for that matter, a SQRT (square root) function, so these as well as PI were added to this program.
<lang rexx>/*REXX program shows hour/sun hour angle/dial hour line angle, 6am->6pm.*/▼
▲<br><br>No attempt was made to explain the inner workings of these functions.
▲/*REXX program shows hour/sun hour angle/dial hour line angle, 6am->6pm.*/
numeric digits 60 /*better overkill then underkill. */
Line 758 ⟶ 756:
sqrtGuess: if x<0 then call sqrtErr; numeric form scientific; m.=11; p=d+d%4+2;
parse value format(x,2,1,,0) 'E0' with g 'E' _ .; return g*.5'E'_%2</lang>
Output:
<pre>
latitude: -4.95
longitude: -150.5
|