EEGG 3D longitude and latitude graph of an egg. ----begin documentation---- Program: EEGG Author: John P. Powers (jpp@cpdvax.csc.ti.com) Date: May 1992 This program draws longitude and latitude lines in three dimensions around a sphere. The routine incorporates a simple form of hidden line removal. The program requires no parameters. Just start the program and watch it draw a sphere. The range parameters chosen for the output window stretch the sphere into an egg or watermelon shape. Modify the program to change the viewing angle of the sphere. The roll (variable rho), yaw (omega), and pitch (phi) all in degrees determine the view of the sphere. Imagine you are the pilot of this sphere-shaped airplane; roll is the angle your wings are tilted (rotation around the axis of your direction of flight); yaw is the angle of the nose of your airplane left or right; pitch is the angle of the nose of your airplane up or down. These three rotations are combined into a transformation matrix T. The longitude and latitude lines are drawn at 15 degree increments in a couple of nested FOR loops. Coordinates for the end points of the line segments are computed by using the built-in spherical vector notation. ----end documentation---- ----begin ascii---- \START\ \COMMENT=Program file dated 10/01/92, 15:34 \NAME=EEGG \FILE=eegg.85P Func FnOff \(-)\1.2\->\xMin 1.2\->\xMax \(-)\1.2\->\yMin 1.2\->\yMax AxesOff Degree \(-)\82\->\\LC-rho\ 0\->\\UC-Omega\ 50\->\\LC-phi\ [[\(-)\cos \UC-Omega\,0,\(-)\sin \UC-Omega\][0,1,0][\(-)\sin \UC-Omega\\#\ ,0,cos \UC-Omega\]]*[[cos \LC-rho\,sin \LC-rho\,0][\(-)\sin \LC-rho\,co\#\ s \LC-rho\,0][0,0,1]]*[[1,0,0][0,cos \LC-phi\,sin \LC-phi\][0,\(-)\sin \#\ \LC-phi\,cos \LC-phi\]]\->\T ClDrw For(LAT,15,165,15) T*[1\angle\0\angle\LAT]\->\PC For(LONG,15,360,15) T*[1\angle\LONG\angle\LAT]\->\TC If PC(3)\>=\0 and TC(3)\>=\0:Line(PC(1),PC(2),TC(1),TC(2)) TC\->\PC End End For(LONG,0,165,15) T*[1\angle\LONG\angle\15]\->\PC For(LAT,20,345,5) T*[1\angle\LONG\angle\LAT]\->\TC If PC(3)\>=\0 and TC(3)\>=\0:Line(PC(1),PC(2),TC(1),TC(2)) TC\->\PC End End \STOP\ ----end ascii---- ----begin uue---- begin 644 eegg.85g M*BI423@U*BH:#`!'V]7;Z%$.#(`"S-2;T0P``LS66]$-C`` M"S-0;PP,H:PS62]$,``OH:HS60T,1#``+T0Q`"]$,``-#*&J,UDO1#``+ZPS M60T-<`P,K#-2+ZHS4B]$,``-#*&J,U(OK#-2+T0P``T,1#``+T0P`"]$,0`- M#7`,#$0Q`"]$,``O1#``#0Q$,``OK#-0+ZHS4`T,1#``+Z&J,U`OK#-0#0T+ M,U1O@V_=$#5,050O1#$U`"]$,38U`"]$,34`$6\S5'`,1#$`+D0P`"XU3$%4 M#0LT4$-OW1`V3$].1R]$,34`+T0S-C``+T0Q-0`1;S-4<`Q$,0`N-DQ/3D;]T0 M-DQ/3D;]X+`/(#$0=%14=' M4$E#\@/P`P`````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M`````?_^`````````````````!X!X?P```````````````____`'\``````` M``````?Q@!@/^#\`````````````##_P`````````Z`8`(`">`/#'@```````!Q`(`$`!`> M,<,T```````!@0/___X@`>`PBP``````!P/]`!`!_P">#$2```````K^`@`0 M`$#Q``G"8M```!P@(`(`$`"`_X`.#)ZP```" M$!`"`!``3P$`,C$JH````A`0`0`('_``@<+"2J````40"`$`/^`@`$X!A$K` M```#B`@#_\0`$`#P!FB5@````/___$`$`!`?$!@9'P````"$`@!``@`)X`G@ M9_D````!0@(`(`$`'@`&`81*`````.(!`!`!'^(`&P8(E``````9`(`0`^`! M@.#8$20`````#_B`/_Q``$\`,")8``````Q'_\0`,`#P`,S%X``````&,"`# M``@/#`<#_H```````8@8`(`$\`,X#!,```````!^!`!`#P`!P#!\```````` M`_H`__#`!CC!X`````````:'_Q@`,#@'QX`````````!X&`$`#_`&#T````` M`````#\8`P/#`&'@````````````___\`,>.``````````````'@/`?_\``` M````````````___X_P``````````````````'P`````````````````````` M```````````````````````````````````````````````````````````` ;`````````````````````````````````.\Y ` end ----end uue----