Jump to content

Horizontal sundial calculations: Difference between revisions

m
→‎{{header|REXX}}: expanded comment about pi.
m (→‎{{header|REXX}}: whitespace)
m (→‎{{header|REXX}}: expanded comment about pi.)
Line 716:
/*─────────────────────────────────────subroutines──────────────────────*/
sep: say indent copies('=',w1) copies('=',w2) copies('=',w3); return
 
pi: return, /*a bit of overkill, but hey !! */
3.1415926535897932384626433832795028841971693993751058209749445923078164062862
/*Note: the real PI subroutine*/
/*returns the number of digits */
/*that matches the current */
/*NUMERIC DIGITS ----- up to */
/*1 million+ digits. Past that,*/
/*it calculates more digits via */
/*John Machin's formula. */
 
d2d2d: return arg(1)//360 /*normalize degrees►1 unit circle*/
d2r: return r2r(arg(1)*pi()/180) /*convert degrees ──► radians. */
r2d: return d2d((arg(1)*180/pi())) /*convert radians ──► degrees. */
Cookies help us deliver our services. By using our services, you agree to our use of cookies.