Jump to content

Horizontal sundial calculations: Difference between revisions

m
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.
 
root)
<br><br>No attempt was made to explain the inner workings of these functions.
<br> 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.
<lang rexx>
/*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>
</lang>
Output:
<pre>
<pre style="height:50ex;overflow:scroll">
latitude: -4.95
longitude: -150.5
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.