From: Matt Birkholz Date: Fri, 16 Mar 2018 19:57:27 +0000 (-0700) Subject: planetarium: Reduce indentation in examples. X-Git-Tag: mit-scheme-pucked-x11-0.2.2~38 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d0ce43b49de61554952a90f0de3602d2429f408d;p=mit-scheme.git planetarium: Reduce indentation in examples. --- diff --git a/src/planetarium/planetarium.texi b/src/planetarium/planetarium.texi index 35874ca85..85815b832 100644 --- a/src/planetarium/planetarium.texi +++ b/src/planetarium/planetarium.texi @@ -64,8 +64,8 @@ To use, startup mit-scheme-pucked and enter the following two s-expressions at the REPL prompt. @example - (load-option 'planetarium) - (define t (make-tellurion)) + (load-option 'planetarium) + (define t (make-tellurion)) @end example A tellurion should pop up in a new window on your desktop. @@ -81,7 +81,7 @@ the message, apply the tellurion to three arguments: the symbol For example, to center the globe on Fairbanks, Alaska, enter this: @example - (t 'turn-to 64.844 -147.723) + (t 'turn-to 64.844 -147.723) @end example You can also have the tellurion draw the terminator as it would appear @@ -91,16 +91,16 @@ time (an integer). (See the reference manual's section ``Date and Time''.) @example - (t 'time-to - ;; a recent vernal equinox - (make-decoded-time 0 29 9 19 3 2016)) + (t 'time-to + ;; a recent vernal equinox + (make-decoded-time 0 29 9 19 3 2016)) @end example You can return the tellurion to the current time by applying it to the symbols @code{time-to} and @code{current}. @example - (t 'time-to 'current) + (t 'time-to 'current) @end example The tellurion redraws every 15 minutes to show the terminator's crawl @@ -109,8 +109,8 @@ it to the symbol @code{stop}. It will pick up where it left off when you apply it to @code{go}. @example - (t 'stop) - (t 'go) + (t 'stop) + (t 'go) @end example @node Terrain Viewer, GNU Free Documentation License, Introduction, Top @@ -124,15 +124,15 @@ mit-scheme-pucked and enter the following three s-expressions at the REPL prompt. @example - (load-option 'planetarium) - (ge '(planetarium terrain)) - (write-function-terrain - "sample-terrain.txt" - -3 3 50 - -3 3 50 - (lambda (x y) - (let ((d^2+1 (+ (* x x) (* y y) 1))) - (* 1000 (/ (sin d^2+1) d^2+1))))) + (load-option 'planetarium) + (ge '(planetarium terrain)) + (write-function-terrain + "sample-terrain.txt" + -3 3 50 + -3 3 50 + (lambda (x y) + (let ((d^2+1 (+ (* x x) (* y y) 1))) + (* 1000 (/ (sin d^2+1) d^2+1))))) @end example A @file{sample-terrain.txt} file will be created in the current @@ -143,14 +143,14 @@ is interpreted as meters given degrees of longitude and latitude. To view your sample terrain enter the following four s-expressions. @example - (define v (make-terrain - 'filename "sample-terrain.txt" - 'rows 50 'columns 50 - 'latitude 0. 'longitude 0. - 'step .001)) - (v 'position -.02 -.02 4000.) - (v 'heading 45.) - (v 'tilt -40.) + (define v (make-terrain + 'filename "sample-terrain.txt" + 'rows 50 'columns 50 + 'latitude 0. 'longitude 0. + 'step .001)) + (v 'position -.02 -.02 4000.) + (v 'heading 45.) + (v 'tilt -40.) @end example A viewer window should appear and display an image like @@ -169,16 +169,16 @@ grid across 1 degree of latitude and longitude centered on Monterey Bay, California. @example - #!/bin/bash - mit-scheme-pucked --batch-mode <<\EOF - (begin - (load-option 'planetarium) - (request-google-elevations "monterey.txt" - (make-latitudes/longitudes - (iota 101 36. .01) - (iota 101 -122.5 .01))) - ) - EOF + #!/bin/bash + mit-scheme-pucked --batch-mode <<\EOF + (begin + (load-option 'planetarium) + (request-google-elevations "monterey.txt" + (make-latitudes/longitudes + (iota 101 36. .01) + (iota 101 -122.5 .01))) + ) + EOF @end example You might name the script @file{~/job.sh} and run it in the background @@ -189,8 +189,8 @@ request elevations only as fast as Google's free service allows, so you might wait an entire day for 10201 elevations to download. @example - $ chmod +x ~/job.sh - $ echo "~/job.sh" | at now + $ chmod +x ~/job.sh + $ echo "~/job.sh" | at now @end example Tomorrow, after you get email saying your job has successfully @@ -198,14 +198,14 @@ completed, you can view the data by entering the following four s-expressions. @example - (ge '(planetarium terrain)) - (define v (make-terrain - 'filename "monterey.txt" 'rows 101 'columns 101 - 'latitude 36. 'longitude -122.5 'step .01 - 'color-function height-color)) - (v 'position 36.5 -122.7 15000.) - (v 'heading 85.) - (v 'tilt -25.) + (ge '(planetarium terrain)) + (define v (make-terrain + 'filename "monterey.txt" 'rows 101 'columns 101 + 'latitude 36. 'longitude -122.5 'step .01 + 'color-function height-color)) + (v 'position 36.5 -122.7 15000.) + (v 'heading 85.) + (v 'tilt -25.) @end example A viewer window should appear and display an image like