/*
--------------------------
Hyperbolic Orbit Animation
--------------------------
Created 7 Mar. 2006
*/
#include "colors.inc"
//Orbit Definition
#declare OrbitA=30;
#declare OrbitE=1.38;
//Scene Constants
#declare EarthRadius=6.356;
#declare SatRadius=1.2;
#declare OrbitWidth=0.5;
#declare LineWidth=0.5/3;
#declare Crosslength=1.5;
#declare Textscale=9;
#declare TextColor=rgb<0,0,0>;
#declare xinit=-35;
//Variables
#declare Minit=OrbitE*sinh(acosh(-(xinit/OrbitA-OrbitE)))-acosh(-(xinit/OrbitA-OrbitE));
#declare M=Minit-2*clock*Minit;
#declare PI=3.14159265359;
#declare Angleinf=180-acos(-1/OrbitE)*(180/PI);
//Anomaly Determination - Solves the equation M=e*sinh(H)-H by the iterative method
#declare Index=0;
#declare prevAnomaly=0;
#declare Anomaly=0;
#while (Index<30)
#declare Anomaly=asinh((M+prevAnomaly)/OrbitE);
#declare prevAnomaly=Anomaly;
#declare Index=Index+1;
#end
//General settings
global_settings{
ambient_light 1
}
light_source { <-50, 0, -70> color White }
camera {
orthographic
location <-10, 0, -10>
look_at <-10, 0, 0>
up <0,100,0>
right <100,0,0>
}
plane { <0, 0, 1>, 8
pigment {White}
finish{ambient 1 brilliance 0}
}
//Earth
sphere {
<0, 0, 0>, EarthRadius
pigment { Blue }
finish{ ambient 0.3 brilliance 1.2 diffuse 0.8}
}
//Orbit
intersection{
box{
<-100,-100,-OrbitWidth>, <100,100,OrbitWidth>
}
quadric{
<1/(OrbitA*OrbitA),-1/(OrbitA*OrbitA*(OrbitE*OrbitE-1)),0>,<0,0,0>,<2*OrbitE/OrbitA,0,0>,OrbitE*OrbitE-1
translate x*OrbitWidth/2
}
quadric{
<-1/(OrbitA*OrbitA),1/(OrbitA*OrbitA*(OrbitE*OrbitE-1)),0>,<0,0,0>,<-2*OrbitE/OrbitA,0,0>,1-OrbitE*OrbitE
translate -x*OrbitWidth/2
}
pigment{ rgb<0.8,0,0> }
finish{ ambient 1 brilliance 0 diffuse 0}
rotate 2.2*y
no_shadow
}
//Satellite
sphere {
<0, 0, -10>, SatRadius
pigment { SeaGreen }
finish{ ambient 1 brilliance 0 diffuse 0}
no_shadow
translate <-OrbitA*(OrbitE-cosh(Anomaly)),OrbitA*sqrt(OrbitE*OrbitE-1)*sinh(Anomaly),0>
}
//Lines
#declare crossBars=
object{
union{
box{
<-LineWidth,-Crosslength,-LineWidth-7>, <LineWidth,Crosslength,LineWidth-7>
}
box{
<-Crosslength,-LineWidth,-LineWidth-7>, <Crosslength,LineWidth,LineWidth-7>
}
rotate z*45
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
no_shadow
}
}
box{
<-OrbitA*OrbitE-3,-LineWidth,-LineWidth-7>, <0,LineWidth,LineWidth-7>
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
no_shadow
}
box{
<0,-LineWidth,-LineWidth-7>, <300,LineWidth,LineWidth-7>
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
rotate z*Angleinf
translate -x*OrbitA*OrbitE
no_shadow
}
box{
<0,-LineWidth,-LineWidth-7>, <300,LineWidth,LineWidth-7>
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
rotate -z*Angleinf
translate -x*OrbitA*OrbitE
no_shadow
}
difference{
torus{
4,LineWidth
rotate x*90
}
box {
<-5,0,-5>,<5,5,5>
}
box {
<-5,-5,-5>,<5,0,5>
rotate -z*Angleinf
}
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
translate -z*7
translate -x*OrbitA*OrbitE
no_shadow
}
object{
crossBars
}
object{
crossBars
translate -x*OrbitA*(OrbitE-1)
}
object{
crossBars
translate -x*OrbitA*OrbitE
}
//Text
text {
ttf "timesi.ttf" "a" 1, 0
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
scale Textscale
translate <OrbitA*(0.5-OrbitE)-Textscale/4,Textscale/4,-7>
no_shadow
}
union{
text {
ttf "timesi.ttf" "r" 1, 0
}
text {
ttf "timesi.ttf" "p" 1, 0
scale 0.5
translate 0.2*x
}
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
scale Textscale
translate <-(EarthRadius+0.3*(OrbitA*(OrbitE-1)-EarthRadius))-Textscale/4,Textscale/4,-7>
no_shadow
}
union{
text {
ttf "symbol.ttf" "u" 1, 0
matrix
< 1, 0, 0,
0.3, 1, 0,
0, 0, 1,
0, 0, 0 >
}
text {
ttf "symbol.ttf" chr(165) 1, 0
scale 0.5
translate <0.6,-0.1,0>
}
pigment{ TextColor }
finish{ ambient 1 brilliance 0 diffuse 0}
scale Textscale
translate <-OrbitA*OrbitE-Textscale/4+9,-0.6*Textscale,-7>
no_shadow
}