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:#`!'<F]U<&5D(&9I;&4@9&%T960@,#4O,#@O.3(L(#$S.C(R
M```-``T`"``V!@@`*0(2!$5%1T<I`B<"8F^1;Z%$,2XR``L]!&]$,2XR``L]
M!6^A1#$N,@`+/09O1#$N,@`+/0=O>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<N
M-4Q!5`T+-%1#;]@T4$,01#,`$51$,`!`-%1#$$0S`!%41#``;I80-%!#$$0Q
M`!$O-%!#$$0R`!$O-%1#$$0Q`!$O-%1#$$0R`!$1;S140PLT4$-OWF_>;]T0
M-DQ/3D<O1#``+T0Q-C4`+T0Q-0`1;S-4<`Q$,0`N-DQ/3D<N1#$U``T+-%!#
M;]T0-4Q!5"]$,C``+T0S-#4`+T0U`!%O,U1P#$0Q`"XV3$].1RXU3$%4#0LT
M5$-OV#100Q!$,P`15$0P`$`T5$,01#,`$51$,`!NEA`T4$,01#$`$2\T4$,0
M1#(`$2\T5$,01#$`$2\T5$,01#(`$1%O-%1#"S100V_>;]X+`/(#$0=%14='
M4$E#\@/P`P``````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````?_^`````````````````!X!X?P```````````````____`'\```````
M``````?Q@!@/^#\````````````<!@!@`,\'X```````````,____^,`P-P`
M`````````?P0`0`>`##_P`````````Z`8`(`">`/#'@```````!Q`(`$`!`>
M,<,T```````!@0/___X@`>`PBP``````!P/]`!`!_P">#$2```````K^`@`0
M`$#Q`</_@``````7"`(`(`"`#P`VS?``````'`@"`"``@`+P#"*X`````&@0
M!!__`0`$#Q.97`````"0'__@0/__Q`#P9,X````!$'`$`$`!`#_@+Q+K````
M`S^@!`!``0`('D#/&H````9@(`0`0`(`"`'^-`;````#H"`(`$`"``@`0<@!
M(```!"!`"`'_____P(`X`.````Q`0?_^0`(`"#__R`"0```41_X(`$`"``@`
M@#@`<```"/A`"`!``@`(`$`X`%````]`0`@`(`$`"!__R`!0```80$`$`"`!
M`__@0!@`<```&$`@!``@__P(`"#D`%````@@(`0?_P$`!`!_!@!P```$("__
MX"``@`0'D#F!T```!__P!``0`(`">`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----
