/*
================================================
Three Angular Parameters of the Elliptical Orbit
------------------------------------------------
Created by Søren Peo Pedersen - see my user page
at http://da.wikipedia.org/wiki/Bruger:Peo
================================================
*/
#declare View=0;
// 0 for all three angles
// 1 for arugment of the periapsis only
// 2 for longitude of the ascending node only
// 3 for inclination only
#declare txtLatLonGrid=texture { // Texture for latitude
pigment {color rgb <.4,.7,1>} // and longnitude lines
finish {ambient .6} // on planet
}
#declare txtPlanet=texture { // Texture for planet
pigment {color rgb <0,.5,1>}
finish {ambient .6}
}
#local txtLatitudes=texture { // Texture with latitudes only
gradient y
texture_map {
[0 txtPlanet]
#local Cnt=-9;
#while (Cnt<9)
[.5+sin(Cnt*.174533-.02)/2 txtPlanet]
[.5+sin(Cnt*.174533-.02)/2 txtLatLonGrid]
[.5+sin(Cnt*.174533+.02)/2 txtLatLonGrid]
[.5+sin(Cnt*.174533+.02)/2 txtPlanet]
#local Cnt=Cnt+3;
#end
[1 txtPlanet]
}
translate <0,-.5,0>
scale 10
}
#local Arrowhead=difference {
box {<-5,-.002,0>,<0,.002,5> rotate <0,45,0> scale <1,1,3>}
plane {<0,0,-1>,-1.5}
}
#macro AngleArc(DegreeNumber,Radius)
merge {
difference {
cylinder {<0,-.002,0>,<0,.002,0>,Radius+.1}
cylinder {<0,-1,0>,<0,1,0>,Radius-.1}
plane {<0,0,1>,0 rotate <0,degrees(asin(1/Radius)),0>}
plane {<0,0,-1>,0 rotate <0,DegreeNumber-degrees(asin(1/Radius)),0>}
}
#object {Arrowhead rotate <0,-6,0> translate <Radius,0,0> rotate <0,DegreeNumber-180,0>}
#object {Arrowhead rotate <0,6,0> translate <-Radius,0,0>}
pigment {color rgb <1,1,1>}
finish {ambient 1}
}
#end
sphere {0,5 // "Main" planet
texture {
object {
union {
#local Cnt=0;
#while (Cnt<18)
box {<-.1,-8,-8>,<.1,8,8> rotate <0,10*Cnt+11,0>}
#local Cnt=Cnt+3;
#end
}
texture {txtLatitudes}
texture {txtLatLonGrid}
}
}
}
#if (View=0 | View=2)
merge { // Arrow poin-
box {<-.1,-.001,0>,<.1,.001,-23>} // ting to re-
#object {Arrowhead translate <0,0,-24>} // ference
pigment {color rgb<.8,.4,1>} // point (typi-
finish {ambient 1 diffuse 0} // cally vene-
rotate <0,0,0> // rian point)
}
#end
#local Sma=20; // Semimajor axis
#local Smi=16; // Semiminor axis
#local Incl=60; // Inclination
#if (View=0|View=2)
#object { // Measures longitude of ascending node
#if (View=2)
AngleArc(60,20)
#else
AngleArc(60,7.5)
#end
rotate <0,210,0>}
#end
#local txtOrbitPlane=texture { // Orbit
pigment {color rgbt<1,.9,0,.5>} // plane
finish {ambient .4} // texture
}
#local txtOrbitMarking=texture { // Texture for
pigment {color rgb<1,.9,0>} // markings on
finish {ambient 1 diffuse 0} // orbit plane
}
union {
disc {0,<0,1,0>,1,0 // Elliptic "disc" indicating
scale <Sma,1,Smi> // the area inside the orbit
translate <sqrt(Sma*Sma-Smi*Smi),0,0>
texture {
#if (View=0|View=3)
object {
difference {
box {<-1,-1,#if (View=0) -9 #else -18 #end>,<1,1,0>}
box {<-.8,-2,-1.8>,<.6,2,1>}
box {<-2,-2,-99>,<.6,2,-2>}
#if (View=0)
translate <16,0,0>
#else
translate <7,0,0>
#end
rotate <0,-40,0>
}
texture {txtOrbitPlane}
texture {txtOrbitMarking}
}
#else
txtOrbitPlane
#end
}
}
difference { // Ourbit edge outline
cylinder {<0,-.001,0>,<0,.001,0>,1
scale <Sma+.15,1,Smi+.15>
}
cylinder {<0,-1,0>,<0,1,0>,1
scale <Sma-.15,1,Smi-.15>
}
translate <sqrt(Sma*Sma-Smi*Smi),0,0>
pigment {
radial
color_map {
[0 color rgbt <1,1,1,0>]
[0.1 color rgbt <1,.95,.5,0>]
[0.3 color rgbt <1,.9,0,0>]
[0.7 color rgbt <1,.9,0,0>]
[.9 color rgbt <1,.9,0,1>]
[1 color rgbt <1,.9,0,1>]
}
rotate <0,-90,0>
}
finish {ambient 1 diffuse 0}
}
#if (View=0)
#object {AngleArc(140,6.5)} // Measures argument of the periapsis
#end
#if (View=1)
#object {AngleArc(140,9)} // Larger arc for argument of periapsis only
#end
#if (View<2)
cylinder { // Line of apsides
<sqrt(Sma*Sma-Smi*Smi)-Sma-5,0,0>,
<sqrt(Sma*Sma-Smi*Smi)+Sma+5,0,0>,.1
pigment {color rgb<1,0,0>}
finish {ambient 1 diffuse 0}
}
#end
#if (View<2)
sphere {<sqrt(Sma*Sma-Smi*Smi)-Sma,0,0>,.5 // Periapsis
pigment {color rgb 1} finish {ambient 1 diffuse 0}
}
#end
#if (View=0)
sphere {<sqrt(Sma*Sma-Smi*Smi)+Sma,0,0>,.5 // Apoapsis
pigment {color rgb 1} finish {ambient 1 diffuse 0}
}
#end
sphere { // Yellow, orbiting "moon"
<0,0,Smi*Smi/Sma>,1
pigment {color rgb <1,.8,0>}
finish {ambient .6}
}
no_shadow
rotate <0,130,Incl>
rotate <0,-60,0>
}
union { // line of nodes
cylinder {<-30,0,0>,<30,0,0>,.1 pigment {color rgb<.3,1,.1>} finish {ambient 1 diffuse 0}}
#if (View!=3)
sphere {<23.6,0,0>,.5 // Ascending node
pigment {color rgb 1} finish {ambient 1 diffuse 0}
}
#end
#if (View=0)
sphere {<-8.8,0,0>,.5 // Descending node
pigment {color rgb 1} finish {ambient 1 diffuse 0}
}
#end
#if (View=0)
#object {AngleArc(60,8) // Measures incllination
rotate <90,-90,0> translate <16.8,0,0>}
#end
#if (View=3)
#object {AngleArc(60,17) // Measures incllination
rotate <90,-90,0> translate <7.8,0,0>}
#end
rotate <0,30,0>
}
#local RefPlaneChecker=texture { // Texture for
pigment {checker // reference
color rgbt<.6,.7,1,.5> // plane
color rgbt<.48,.56,.8,.5>
scale 3
}
finish {ambient .4}
}
#local RefPlaneMark=texture { // Texture for
pigment {checker // markings on
color rgbt<.6,.7,1,0> // reference
color rgbt<.48,.56,.8,0> // plane
scale 3
}
finish {ambient 1 diffuse 0}
}
merge { // The reference plane
triangle {<-9,0,-21>,<21,0,-21>,<-9,0,9>}
triangle {<21,0,9>,<21,0,-21>,<-9,0,9>}
texture {
#if (View=0|View=3)
object {
difference {
box {<-1,-1,#if (View=0) -9 #else -18 #end>,<1,1,0>}
box {<-.8,-2,-1.8>,<.6,2,1>}
box {<-2,-2,-99>,<.6,2,-2>}
#if (View=0)
translate <16,0,0>
#else
translate <7,0,0>
#end
rotate <0,30,0>
}
texture {RefPlaneChecker}
texture {RefPlaneMark}
}
#else
RefPlaneChecker
#end
}
}
union {
// A, B, C, and D are common for all four images...:
text {ttf "timesbi.ttf","A",.001,0 // A: Orbiting body
scale .0035 translate <.0045,.0132,0>}
text {ttf "timesbi.ttf","B",.001,0 // B: Body being orbited
scale .0035 translate <-.0045,.0092,0>}
text {ttf "timesbi.ttf","C",.001,0 // C: Reference plane
scale .0035 translate <-.016,-.002,0>}
text {ttf "timesbi.ttf","D",-.001,0 // D: Orbital plane of A
scale .0035 translate <-.002,-.014,0>}
#switch (View) // Deal with "special cases" in each of the four images:
#case (0) // Letter markings for viewing all three angles
text {ttf "symbol.ttf","W",.001,0 // "Upper-case" Omega at the lon-
scale .0035 translate <-.002,.003,0>} // gidtude of ascending node
text {ttf "symbol.ttf","w",.001,0 // "Lower-case" omega at the
scale .0035 translate <.0009,.0158,0>} // argument of the periapsis
text {ttf "timesbi.ttf","i",.001,0 // "Lower-case" i at
scale .0035 translate <.0045,-.0083,0>} // the inclination
text {ttf "timesbi.ttf","E",.001,0 // E: Descending node
scale .0035 translate <-.011,.013,0>}
text {ttf "timesbi.ttf","F",.001,0 // F: Periapsis
scale .0035 translate <-.008,.0175,0>}
text {ttf "timesbi.ttf","G",.001,0 // G: Ascending node
scale .0035 translate <.0149,-.003,0>}
text {ttf "timesbi.ttf","H",.001,0 // H: Apoapsis
scale .0035 translate <.006,-.0182,0>}
text {ttf "timesbi.ttf","J",.001,0 // J: Reference direction,
scale .0035 translate <-.0145,-.014,0>} // e.g. Verial point
#break
#case (1) // Letter markings for viewing only argument of periapsis:
text {ttf "symbol.ttf","w",.001,0 // "lower-case" omega at
scale .007 translate <.0053,.01,0>} // arugment of periapsis
text {ttf "timesbi.ttf","E",.001,0 // E: Ascending node
scale .0035 translate <.0149,-.003,0>}
text {ttf "timesbi.ttf","F",-.001,0 // F: Periapsis
scale .0035 translate <-.0085,.0167,0>}
#break
#case (2) // Letter markings for viewing only longitude of asc. node:
text {ttf "symbol.ttf","W",.001,0 // "Upper-case" Omega at
scale .007 translate <.004,-.01,0>} // longitude of ascending node
text {ttf "timesbi.ttf","E",.001,0 // E: Ascending node
scale .0035 translate <.0149,-.003,0>}
text {ttf "timesbi.ttf","F",.001,0 // F: Reference direction,
scale .0035 translate <-.0145,-.014,0>} // e.g. Vernial point
pigment {color rgb<1,1,1>}
#break
#case (3) // Letter markings for viewing only the inclination:
text {ttf "timesbi.ttf","i",.001,0 // "Lower-case" i at
scale .007 translate <-.011,-.012,0>} // the inclination
#break
#end
pigment {color rgb<1,1,1>} // Common settings
finish {ambient 1 diffuse 0} // for the letters
no_shadow // in the images
translate <0,0,.04>
rotate <51.3765,-13.62699,0>
translate <11,26,-33>
}
camera { // Viewpoint - DO NOT CHANGE without recalculating the
right <1,0,0> up <0,1,0> // translates and rotate above - they align the letter
location <11,26,-33> // markings in the image with the camera's viewing an-
look_at <3,-16.5,0> // gle!!
angle 55
}
light_source {<10000,5000,-5000> color rgb 1}