Документ взят из кэша поисковой машины. Адрес оригинального документа : http://star.arm.ac.uk/~csj/movies/povray/binary.pov
Дата изменения: Fri Mar 29 17:51:47 2002
Дата индексирования: Tue Oct 2 07:54:58 2012
Кодировка:

Поисковые слова: aircraft
/* Binary

Simulate a general binary system

Created with POVRAY

Dr C. Simon Jeffery
Armagh Observatory
2001 July

*/

/* Global Definitions

Normalized unit system :
Units of Mass (mass) : 1 Solar Mass
Units of Time (clock) : 1 hour ?
Units of distance : 1 Solar Radius

*/


#include "colors.inc"

background { color Black } // the sky is black - Olber's paradox


// Astronomical Constants

#declare AU_Rsun = 214.9425 ; // Astronomical unit in solar radii



// declare the binary geometry

#declare Mass_1 = 2.27; // solar masses
#declare Temp_1 = 4.5 ; // kilo kelvin
#declare Rad_1 = 9.01; // solar radii

#declare Mass_2 = 0.304;
#declare Temp_2 = 31.5;
#declare Rad_2 = 0.052;

#declare OrbPeriod = 21; // days
#declare OrbEccen = 0; //

#declare OrbInc = 89; // degrees


// derived parameters

#declare OrbP_yr = OrbPeriod / 365.25;
#declare OrbInc_rad = OrbInc * pi/180.; // radians

#declare Mass_Ratio = Mass_2 / Mass_1;
#declare Mass_Sum = Mass_2 + Mass_1; // Total mass of stars
#declare Mass_Red = Mass_2 / Mass_Sum; // Reduce mass of stars

#declare OrbSep_au = pow ( Mass_Sum * pow(OrbP_yr,2) , 1./3.) ; // AU
#declare OrbSep = OrbSep_au * AU_Rsun;

#declare Asep_1 = OrbSep * Mass_2 / Mass_Sum;
#declare Asep_2 = OrbSep * Mass_1 / Mass_Sum;


// phase properties

#declare Phase = clock;
#declare Phase_deg = clock * 360;



// camera position

#declare cam_loc = 3*<1,cos(OrbInc_rad),-sin(OrbInc_rad)>*OrbSep;
#declare cam_aim = <0,0,0>;


// Star colours

#if (Temp_1 < 10)
#declare Cred_1 = max( 1.- Temp_1/50. ,0.8);
#declare Cgrn_1 = max( Temp_1/15. ,0.3);
#declare Cblu_1 = max( Temp_1/30. ,0.0);
#else
#declare Cred_1 = 0.8;
#declare Cgrn_1 = max( 1. - (Temp_1-10.)/100. ,0.9);
#declare Cblu_1 = min( Temp_1/30. ,1.0);
#end

#if (Temp_2 < 10)
#declare Cred_2 = max( 1.- Temp_2/50. ,0.8);
#declare Cgrn_2 = max( Temp_2/15. ,0.3);
#declare Cblu_2 = max( Temp_2/30. ,0.0);
#else
#declare Cred_2 = 0.8;
#declare Cgrn_2 = max( 1. - (Temp_2-10.)/100. ,0.9);
#declare Cblu_2 = min( Temp_2/30. ,1.0);
#end


#declare Color_1 = < Cred_1, Cgrn_1, Cblu_1 > ;
#declare Color_2 = < Cred_2, Cgrn_2, Cblu_2 > ;

#declare Spot_1 = < Cred_1-0.1, Cgrn_1-0.1, Cblu_1-0.1 > ;

/*

Ultimately need to define the surface of each star
- in close binaries -
as a Roche equipotential

*/



/*

Primary star (with spots)

*/


union {
sphere { 0,1
texture {
bozo
scale 0.3
turbulence 0.9
texture_map {
[ 0.0
pigment { rgb <1,1,1>}
finish { diffuse 0.8 ambient Color_1 }
]
[ 0.7
pigment { rgb <1,1,1>}
finish { diffuse 0.8 ambient Color_1 }
]
[ 1.0
pigment { rgb <1,1,1>}
finish { diffuse 0.8 ambient Spot_1 }
]
}
rotate <0,Phase_deg,0>
warp {
black_hole <0, 0, 1>, 1.4
}
warp {
black_hole <0, 1, 0>, 1.4
inverse
}
warp {
black_hole <0, -1, 0>, 1.4
inverse
}

}
hollow
}
scale max(Rad_1,Rad_2/50.)
translate <0,0,-Asep_1>
rotate <0,Phase_deg,0>
}

/*

Secondary star

*/

union {
sphere {
0 , 1
texture {
pigment { rgb Color_2 }
finish { ambient 1 diffuse 0.8 }
}
no_shadow
}
light_source {
0 , colour <0,0,1>
media_attenuation on
}
light_source {
0 , colour <0,1,0>
media_attenuation on
fade_distance OrbSep
fade_power 2
}
scale max(Rad_2,Rad_1/50.)
translate <0,0,Asep_2>
rotate <0,Phase_deg,0>
}




// Lens flare definitions

// cam_loc already defined
#declare light_loc = vrotate(<0,0,Asep_2>,<0,Phase_deg,0>);
#declare lookat = cam_aim;
#declare sky_vect = <0,1,0>;
#include "space1.flr"

// flare does not eclipse

/*
#declare dist = 16./vlength(cam_loc-light_loc);
#declare flare_size = 1;
#declare flare_brightness = 1*dist;

#declare light_rad = Rad_2;
#declare planet_loc = vrotate ( <0,0,-Asep_1>,<0,Phase_deg,0>);
#declare planet_rad = 0; // Rad_1;
#declare bright_background = false;
#declare ring_color = <0.7,0.7,1>;
#declare glow_color = <0.4,0.7,1>;
#declare num_spots = 3;
#declare glow_size = 0.05;
#declare source_size = 0.005;
*/

#include "nkflare.inc"





camera {
location cam_loc
direction <0,0,2>
look_at cam_aim
}

global_settings {
max_trace_level 20
}







/*
spare code
*/


/*
sphere { 0,1
pigment { rgbt 1}
finish {
fade_distance 0.1
fade_power 2
}
halo {
dust
spherical_mapping
linear
colour_map {
[0.0 rgbt <1,1,1,-3> ]
[0.9 rgbt <1,1,1,-2>]
[1.0 rgbt <1,1,1,1> ]
}
}
hollow
}
*/
/*
sphere {
0,1.3
pigment { rgbt 1 }
halo {
emitting
spherical_mapping
linear
turbulence 0
colour_map {
[0.0 rgbt <1,0,0,1> ]
[0.1 rgbt <1,0,0,0> ]
[1.0 rgbt <1,0,0,0> ]
}
}
scale 1.1
hollow
}
*/

/*
light_source {
<0,0,0> , colour <1.5,0,0>
}
*/