
'--Functions-------------------------------------------------------------------

'XYZ2LLA(Lat,Lon,Alt,X,Y,Z) Transform in spherical coordinates (Lat,Lon,Alt) any cartesian coordinates (X,Y,Z)
'    <param name="x">Greenwich meridian and normal to Z axis (m)</param>
'    <param name="y">Normal to X axis and Z axis (m)</param>
'    <param name="z">Earth rotation axis (m)</param>
'    <returns>LLA coordinates (latitude, longitude, altitude)</returns>
'    <remarks>
'    <para>Transform in spherical coordinates (Lat,Lon,Alt) any cartesian coordinates (X,Y,Z)</para>
'Rad        Conversion factor from degrees to radians angles
'A, A2      The NATO registered major semiaxis (m) and squared major semiaxis inside the ecuatorial plane (m2)
'B, B2      The minor semiaxis in Z axis (m) and squared minor semiaxis in Z axis (m2)
'E          The eccentricity. e{0:circular, (0,1):ellipsoid, 1:paraboloid >1:hyperboloid
'E2, E4     The NATO registered squared eccentricity and double squared eccentricity
'EE, EE2    The second eccentricity and squared second eccentricity

'Dim Mt As Double, Mp As Double, Mf As Double, Ms As Double, dV As Double, Isp As Double, G0 As Double
'G0 = 9.80665: Isp = 260
'dV = 13490: Ms = 1: Mf = 3.76
'Do
'    Mp = ((Mf + Ms) * (1# - (Exp(-dV / (Isp * G0))))) / (1# - (1# - (Exp(-dV / (Isp * G0)))))
'    Mt = Mp + Ms + Mf
'    Stop: Debug.Print Ms, Mp, Mt, Format(Ms / Mt * 100, "0.00")
'    Ms = Ms + 0.001
'    Loop
'Stop

'--Real_examples---------------------------------------------------------------

'Dry mass:
' 2.51%  Ariane 5
' 4.33%  Saturn V
' 6.49%  Shuttle (with payload)
'43.48%  X-15
'50.00%  Concorde/Boeing747

'Lift-to-drag ratios:
'Sailplane      70
'Lockheed U-2   28
'Boeing 747     17
'Cessna 150     7
'Concorde       4/7 (subsonic/supersonic)
'Space Shuttle  4.5/1 (subsonic/hypersonic)
'Apollo CM      0.4

'Name       Thrust      Isp     Time   Mass-Empty   Size       Fuel      kg*s/kg         kg/kg

'Titan 1                             105140kg      31x3x3m
'Stage 1 1296-1467kN 256-290isp 138s  76203-4000kg 16x3x3m     LOX       0.00396-0.00350 1.73-1.96
'Stage 2  243- 356kN 210-308isp 255s  28939-1725kg 10x2x2m     LOX       0.00431-0.00294 0.86-1.25
'PayLoad                               1800kg

'Titan 3                             156540kg      45x3x3m
'Stage 1    ?-2108kN     ?-?isp   ?s 117020-4760kg 21x3x3m     A-50/N2O4                    ?-1.84
'Stage 2    ?- 445kN     ?-?isp   ?s  29030-2760kg  7x3x3m     A-50/N2O4                    ?-1.56
'Stage 3    ?-  71kN     ?-?isp   ?s   7160-1045kg  7x1.5x1.5m UDMH/N2O4                    ?-1.01
'PayLoad                               3000kg

'Vega                                137000kg      30x3x3m
'1:P80      ?-3040kN     ?-?isp 107s F88000-10376?  ?x3x3m     Solid     0.00265?           ?-3.10
'2:Zefiro23 ?-1200kN     ?-?isp  72s F23900- 2818?  ?x2x2m     Solid     0.00273?           ?-4.58
'3:Zefiro9  ?- 213kN     ?-?isp 117s F10100- 1191?  ?x2x2m     Solid     0.00398?           ?-1.92
'4:AVUM     ?-   2.5kN   ?-?isp 315s   F550-   65?  ?x2x2m     UDMH/N2O4 0.00684?           ?-0.41
'PayLoad                               1500kg (LEO 700km)

'--Simulator_examples----------------------------------------------------------

'Travel to the Sun (Default-Moon-Preset)
'Mass=1470kg Lat=-20 Lon=-157.5 Earth=154 Heading=68.3 Hover=1.5kg Ve=12.986km/s T=253das

'Picorover of 500g to the Moon
'1470 kg APCP 30s 46-90 16-60km 27.0  9.5kg 20% 2:11:48 (Default 2 stages)
'1290 kg APCP-APCP-MMH 80-15-5% 3-5-5% 150% 3s 40-90 16-60km 23.5 2:11:32 (Default 3 stages)
'3020 kg APCP 30s 52-90 18-60km 33.0 14.5kg 20% 1:00:01
'552.0kg APCP 30s 43-90 18-59km 26.4  2.5kg 20% 1:12:03
'373.0kg APCP 30s 43-90 19-59km 25.3  1.6kg 20% 2:00:23
'255.0kg APCP 30s 38-90 18-58km 27.5  0.9kg 10% 2:12:27
'234.5kg APCP 30s 38-90 18-58km 36.0  0.8kg 10% 3:13:26
'234.0kg APCP 30s 38-90 18-58km 42.0  0.8kg 10% 4:02:59
'119.5kg MMH  30s 39-90 19-63km 26.0  0.9kg 10% 2:11:20
'110.0kg MMH  30s 39-90 19-63km 36.0  0.8kg 10% 3:15:29
'109.8kg MMH  30s 39-90 19-63km 42.0  0.8kg 10% 4:05:38
'10.17kg LF2LH2/LLi Stages=60-30-10% 3-3-3-3% 300-300-300-300% 3s 40-90 16-50km 40.0 Hover=0.350kg Dm=0.08 Cd=0.5 3:10:12
'9.962kg LF2LH2/LLi Stages=60-30-10% 3-3-3-3% 260-350-300-300% 3s 40-90 14-48km 55.0 Hover=0.340kg Dm=0.08 Cd=0.5 4:23:05
'8.278kg LF2LH2/LLi Stages=60-25-15% 3-3-3-3% 260-350-300-300% 3s 39-90  1-42km 55.0 Hover=0.333kg Dm=20:1 Cd=0.1 5:00:33

'--Data------------------------------------------------------------------------

'         Radius      Mass        Orbit..Radius     ..Time      ..Speed   RotationTime  SurfaceGravity    ScapeSpeed  Gravity
'                                                                                                                              '
'Sun         695500km   1.9891e30kg      2.5e17km 2.252.50e8a     220km/s?       25.05d         274m/s2     617700m/s   27.94G
'Earth         6371km   5.9736e24kg 149597887.5km  365.256366d  29.783km/s      86164.1s    9.780327m/s2      11186m/s       1G
'Moon          3474km   7.3477e22kg      384399km   27.321582d    1.03km/s    27.321582d       1.622m/s2       2380m/s  0.1654G
'Aphelion/Perihelion/Semi-major axis    152097701000  147098074000  149597887500
'Perigee/Apogee/Semi-major axis            363104000     405696000     384399000

'Radius Equatorial  Polar       Mean
'Earth  6378137     6356752.3   6371000
'Moon   1738140     1735970     1737100

'Earth orbit plane / Ecliptic coordinate system
'   X=1,Y=0->0X=0,Y=1->90X=-1,Y=0->180X=0,Y=-1->270
'   X=Cos(A) Y=Sin(A) A=Atn(Y/X) A+=ClockWise A-=CounterClockWise (from Z+ to Z-)

'Date and time system
'J2000 = 2000AC Jan 1.5 = 12h on January 1 of 2000AC -> JD 2451545.0 = 4713BC Jan 1.5
'PlanetsFN=200011.5=-730531.5 MoonFN=19991231?=-730530

'Fuel and oxidizer list
'           IspS-Vc O/F     Density-g/cc        Cost $/kg   Name                                                    Chemical formulation
'LF2+30%LH2/LLi 542 ?       ?    =?    /6.940   ?    /20.00 Liquid Fluorine + 30% Liquid Hydrogen / Liquid Lithium  F2 / H2 / Li
'LF2/LLi    ?   458 ?       ?    =1.510/6.940   20.00/20.00 Liquid Fluorine / Liquid Lithium                        F2 / Li
'LF2/LH2    410 470 8.00    0.460=1.510/0.071   20.00/ 3.60 Liquid Fluorine / Liquid Hydrogen                       F2 / H2
'LF2/UDMH   341 403 2.55    1.200=1.510/0.793   20.00/24.00 Liquid Fluorine / UnSymmetrical-DimethylHydrazine       F2 / (CH3)2NNH2
'LO2/LH2    391 451 6.00    0.330=1.140/0.071    0.08/ 3.60 Liquid Oxygen / Liquid Hydrogen                         O2 / H2
'LO2/UDMH   310 363 1.67    0.970=1.140/0.793    0.08/24.00 Liquid Oxygen / UnSymmetrical-DimethylHydrazine         O2 / (CH3)2NNH2
'LO2/RP-1   300 353 2.56    1.020=1.140/0.806    0.08/ 0.20 Liquid Oxygen / Kerosene                                O2 / ?
'N2O4/MMH   288 336 2.16    1.200=1.450/0.880    6.00/17.00 Nitrogen Tetroxide / MonoMethyl-Hydrazine               N2O4 / CH3NHNH2
'N2O4/UDMH  285 333 2.61    1.180=1.450/0.793    6.00/24.00 Nitrogen Tetroxide / UnSymmetrical-DimethylHydrazine    N2O4 / (CH3)2NNH2
'N2O4/RP-1  276 323 4.04    1.250=1.450/0.806    6.00/ 0.20 Nitrogen Tetroxide / Kerosene                           N2O4 / ?
'H2O2/UDMH  278 325 4.54    1.240=1.440/0.793    2.00/24.00 Hydrogen Peroxide / UnSymmetrical-DimethylHydrazine     H2O2 / (CH3)2NNH2
'H2O2/RP-1  273 319 7.35    1.310=1.440/0.806    2.00/ 0.20 Hydrogen Peroxide / Kerosene                            H2O2 / ?
'APCP       220 260 -       1.459               37.85       Ammonium Perchlorate Composite Propellant               ?

'Effect of simulation parameters over the burn out speed an gross mass
'   Cd=.5  Cd=.05 -G     -VA    -Fe    -Ve    +10km +277m/s  +20km +500m/s  +wings
'Ve 11065  11702  11944  11757  11325  10941  11737 11851    12130 12490    12934
' %        +5.8%  +7.9%  +6.3%  +2.3%  -1.1%  +6.1% +7.1%    +9.6% +12.9%   +16.9%
'M  815    522    462    501    692    887    516   488      414   342      291
' %        -36%   -43%   -39%   -15%   +9%    -37%  -40%     -49%  -58%     -64%

'Effect of lenght/diameter ratio over the gross mass
' 3.2:1 805kg 0.2879m 60.54cm x 1.92m 16-60km Drag=709.193m/s
' 5.0:1 697kg 0.1928m 52.20cm x 2.61m 16-58km Drag=538.887m/s
'10.0:1 604kg 0.1104m 37.50cm x 3.75m 16-56km Drag=348.340m/s

'Deviation in orbital speed .. V+-1m/s = +-1km  H+1m/s = +3.5km  H-1m/s = -3.5km

'Moon rotation around Earth in a specific time
' 0.55 in 1h
' 0.82 in 1h 30m (LEO orbit)
'13.18 in 1d
' 1.50 range when approaching to hit the Moon

'Circle length=Pi*R*2=Pi*D    Circle area=Pi*R=Pi*D/4
'Sphere area=Pi*R*4=Pi*D  Sphere volume=Pi*R*4/3=Pi*D/6
'Sphere area=Circle area*4

'Solar wind
'Magnetic Field .. B=Sqr(Bx^2+By^2+Bz^2) .. B=6.3nT, Bx=-2.0nT, By=5.5nT, Bz=2.4nT .. Based on GSM coordinates
'Plasma .. P=1.6726E-6*n*V^2 .. Pressure,P=0.3nPa Speed,V=458.5km/s Temperature,T=108328.2K Density,n=0.8particles/cm^3

'Average Earth magnetic field = 0.5 Gauss = 5E-5 tesla
'1N = 5E-5 * 1A/m .. 1A/m = 1N / 5E-5
'1T = 1Vs/m = 1N/(A/m) = 1Wb/m = 1kg/(Cs) = 1kg/(As)
'1 tesla = 10000 gauss
'1 tesla is defined as the field intensity generating 1 newton of force per ampere of current per meter of conductor

'Thermal equilibrium
'Sun luminosity=3.846E+26 W
'Sigma=5.6703E-8 (Stefan-Boltzmann constant)
'Albedo=Albedo1*Area1/Area+Albedo2*Area2/Area+...
'Emissivity=Emissivity1*Area1/Area+Emissivity2*Area2/Area+...

'QOut=(QDisipated+QElectric)*Emissivity*Area
'QDisipated=Sigma*T^4                               .. Disipated to space
'QElectric=Electrical power                         .. Electrical heat

'QIn=((QSun+QPlanets+QInfrared+QDrag)/4+QSpace+QConductivity)*(1-Albedo)*Area
'LSun=3.846E+26 W                                   .. Sun luminosity
'LAstro=4*PI*Astro.R^2*Sigma*T^4*Emissivity         .. Astro luminosity
'QSun=LSun/4/PI/Sun.H^2                             .. Sun radiation
'QAlbedo=QSunPlanet*Albedo*Planet.R^2/Planet.H^2    .. Planet albedo
'QInfrared=LPlanet/4/PI/Planet.H^2                  .. Planet infrared
'QDrag=Cd*0.5*AirDensity*V^3                        .. Air drag heat
'QConductivity=?                                    .. Air conductivity heat

'LSun=3.84146907737904493E+26 W  LEarth=196656450781349927 W
'QSun=1367.56663381698054 W/m   QAlbedo=478.648321835943189 W/m QInfrared=384.689777528700001 W/m^2

'QIn=Alpha*I*F*A=213+209.024+168.36+Qe QSun=0.15*1420*1.0=213*A QAlbedo=0.92*454.4*0.5=209.024*A QInfrared=0.92*244.0*0.75=168.36*A

'Temperature conversion Celsius-Fahrenheit-Kelvin-Rankine
'C=K-273.15 K=C+273.15  C=(F-32)*5/9 F=C/5*9+32  R=F+459.69=K/5*9+0.02

'Force conversion
'G0 = 9.80665
'1 lb (pound) = 0.4536 kg
'1 lbf/in (pound-force/inch) = 17.8579675006 kg/m = 175.126836986N/m

'Air pressure  .. H=Altitude(ft) T=Temperature(C) P=Pressure(kPa) D=Density(kg/m)
'Earth:H<11000 .. T= 15.04-0.00649*H  .. P=101.29*((T+273.15)/288.08)^5.256
'11000<H<25000 .. T=-56.46            .. P=22.65*e^(1.73-0.000157*H)
'25000<H       .. T=-131.21+0.00299*H .. P=2.488*((T+273.15)/216.6)^-11.388
'                 D=P/0.2869/(T+273.15)
'Mars: H<7000  .. T=-31-0.000998*H    .. P=0.699*e^(-0.00009*H)
'      H>7000  .. T=-23.4-0.00222*H   .. P=0.699*e^(-0.00009*H)
'                 D=P/0.1921/(T+273.15)
'ISA example: D=P/R/T .. 101325/287.05/(15+273.15)=1.2250kg/m
'D=1.225=Density(kg/m)          P=101325=Pressure(Pa)
'R=287.05=Gas constant(J/kg/K)  T=15+273.15=Temperature(K) (C+273.15)

'Sound speed .. V=Sqr(G*R*T)
'V=Sound speed(m/s)  T=Temperature(K) (C+273.15)
'G=Ratio of specific heats .. 1.4=Earth 1.29=Mars
'R=Gas constant(m/s/K)  .. 286=Earth 191.277=Mars
'  Mach1=343m/s=1236kph=768mph Mach5=1715m/s Mach23=7889km/s
'  Mach1 .. 0m=340m/s(15C) 15km=295m/s(-57C) 30km=301m/s(-48C)

'Air drag ..                 F=0.5*Cd*A*D*V KB=0.5*Cd*A
'Lift     ..                 F=0.5*Cl*A*D*V
'F=Force(N) D=Air density(kg/m) V=Air speed(m/s) A=Front area(m)
'Cd=Drag coefficient Cl=Lift coefficient KB=Ballistic coefficient
'Dynamic pressure .. P=0.5*D*V

'Centripetal acceleration .. A=V/R A=W*R
'A=Acceleration(m/s)  V=Tangential speed(m/s)  W=Angular speed(Rad)  R=Radius(m)

'Terminal distance ..        E=V/A/2
'V=Initial speed A=Deceleration

'Terminal velocity ..        V=Sqr((2*M*G)/(Cd*D*A))
'M=Mass(kg)  G=Earth gravity(m/s)  Cd=Drag coefficient  D=Air density(kg/m)  A=Front area(m)
'0.05-0.75 10kg=13-52m/s 1000kg=27-105m/s 100000kg=58-226m/s

'Escape speed  ..            V=Sqr(2*G*M/H) H=2*G*M/V-R
'Orbital speed ..            V=Sqr(G*M/H)   H=G*M/V-R
'Earth
'  0km=7906.301  10km=7900.111  20km=7893.934  50km=7875.492 100km=7845.041
'150km=7814.940 200km=7785.183 300km=7726.675 500km=7613.509   1Mm=7351.008
'  2Mm=6898.371   5Mm=5919.496  10Mm=4933.874  50Mm=2659.285 100Mm=1935.950
'Moon
'  0km=1679.715  10km=1674.904  50km=1656.064 100km=1633.385 500km=1480.247
'  1Mm=1338.290   5Mm= 853.116  10Mm= 646.366  50Mm= 307.874 100Mm= 219.551
'GEO=35.786Mm(3075.682m/s) GPS=20.2Mm Glonass=19.1Mm Galileo=23.222Mm

'ASin(X)=ATan(X/Sqr(1-X))
'ACos(X)=ATan(Sqr(1-X)/X)

'x87 Single Precision   32= 8+1+23  +/-9999999!
'x87 Double Precision   64=11+1+52  +/-999999999999999#
'x87 Extended Precision 80=15+1+64  +/-9999999999999999999

'VBType  Bytes Char Limits
'Boolean    2       -1, 0
'Byte       1       0, 255
'Integer    2   %   -32768, +32767
'Long       4   &   -2147483648, +2147483647
'Single     4   !   +/-1.401298E-45, +/-3.402823E+38
'Double     8   #   +/-4.94065645841247E-324, +/-1.79769313486232E+308
'Currency   8   @   -922337203685477.5808, +922337203685477.5807
'Decimal   14       +/-0,0000000000000000000000000001, +/-79228162514264337593543950335
'Date       8       1 january 100, 31 december 9999
'Object     4
'String    10+len*2
'Variant 16/22+len*2

'---APOLLO LANDING SITES--------------------------------------------------------

'Mission    Site Location   Latitude    Longitude   Date of Landing

'11 Mare Tranquillitatis    041'15" N  2326' E    July 20, 1969
'12 Oceanus Procellarum     311'51" S  2323'8" W  Nov. 19, 1969
'14 Fra Mauro               340'24" S  1727'55" W Feb. 5, 1971
'15 Hadley-Apennines        2606'03" N 0339'10" E July 30, 1971
'16 Descartes               859'29" S  1530'52" E April 21, 1972
'17 Taurus-Littrow          209'55" N  3045'57" E Dec. 11, 1972

'---LAUNCH SITES----------------------------------------------------------------

'Country    Launch site                                 Latitude - Longitude

'Russia     Plesetsk Space Center                       62.8 N 40.1 E
'Russia-Kazakstan Baikonur space center/Tyuratam        45.6 N 63.4 E
'Russia     Kapustin Yar test center                    48.4 N 45.8 E
'Russia     Svobodny space center                       51.4 N 128.3 E
'USA        Cape Canaveral/KSC, Eastern Test Range (ETR)  28.5 N 81.0 W
'USA        Vandenberg AFB,  Western Test Range (WTR)   34.4 N 120.35 W
'USA        Wallops Flight Facility, Wallops Island     37.8 N 75.5 W
'USA        Edwards AFB, Air Force Flight Test Center   35 N   118 W
'USA        Kodiac Launch Complex, Kodiac Island        -   -
'USA        Reagan Test Site, Kwajalein Island          9 N    167 E
'France     Kourou, Guiana Space Centre                 5.2 N  52.8 W
'France     Hammaguir                                   31.0 N 8.0 W
'Japan      Tanegashima Space Center (TNSC)             30.4 N 131.0 E
'Japan      Uchinoura Space Center (USC)                31.2 N 131.1 E
'China      Jiuquan                                     40.6 N 99.9 E
'China      Xichang                                     28.25 N 102.0 E
'China      Taiyuan/Wuzhai                              37.5 N 112.6 E
'Italy      San Marco platform                          2.9 S  40.3 E
'India      Sriharikota (SHAR)                          13.9 N 80.4 E
'Israel     Palmachim/Yavne                             31.5 N 34.5 E
'Australia  Woomera                                     31.1 S 136.8 E
'Brazil     Alcantara                                   2.3 S  44.4 W
'Spain      Torrejon AB                                 40.5 N 3.5 W

'---EARTH-----------------------------------------------------------------------
'6371.0km 149597887.5km 365.256366d 29.783km/s 5.9736x10^24kg 9.780327m/s

'Aphelion                       152097701 km (1.0167103335 AU)
'Perihelion                     147098074 km (0.9832898912 AU)
'Semi-major axis                149597887.5 km (1.0000001124 AU)
'Eccentricity                   0.016710219
'Orbital period                 365.256366 days (1.0000175 yr)
'Average orbital speed          29.783 km/s (107218 km/h)
'Inclination                    134'43.3" to Invariable plane
'Longitude of ascending node    348.73936
'Argument of perihelion         114.20783
'Satellites                     1 (the Moon)

'Physical characteristics

'Mean radius                    6371.0 km
'Equatorial radius              6378.1 km
'Polar radius                   6356.8 km
'Flattening                     0.0033528
'Circumference                  40075.02 km (equatorial)
'                               40007.86 km (meridional)
'                               40041.47 km (mean)
'Surface area                   510072000 km
'                               148940000 km land  (29.2 %)
'                               361132000 km water (70.8 %)
'Volume                         1.0832073 x 10^12 km
'Mass                           5.9736 x 10^24 kg[8]
'Mean density                   5.5153 g/cm
'Equatorial surface gravity     9.780327 m/s (0.99732 g)
'Escape velocity                11186 m/s
'Sidereal rotation period       0.99726968 d
'                               23h 56m 4.1s
'Equatorial rotation velocity   1674.4 km/h (465.1 m/s)
'Axial tilt                     23.439281
'Albedo                         0.367
'Surface temp.                  min     mean    max
'                   Celsius     -89 C  14 C   57.7 C
'                   Kelvin      184 K   287 K   331 K

'Atmosphere

'Surface pressure               101.3 kPa (MSL)
'Composition                    78.08% Nitrogen (N2)
'                               20.95% Oxygen (O2)
'                               0.93% Argon
'                               0.038% Carbon dioxide
'                               About 1% water vapor (varies with climate)

'---MOON------------------------------------------------------------------------

'3474km 384403km 27.3d 0.17G 107C -153C 7.3477x10^22kg 1.622 m/s

'Perigee                        363104 km  (0.002 4 AU)
'Apogee                         405696 km  (0.002 7 AU)
'Semi-major axis                384399 km  (0.002 57 AU[1])
'Eccentricity                   0.054 9[1]
'Orbital period                 27.321582 d  (27 d 7 h 43.1 min[1])
'Synodic period                 29.530589 d  (29 d 12 h 44 min 2.9 s)
'Average orbital speed          1.022 km/s
'Inclination                    5.145 to the ecliptic[1]
'                               (between 18.29 and 28.58 to Earth's equator)
'Longitude of ascending node    regressing by one revolution in 18.6 years
'Argument of perigee            progressing by one revolution in 8.85 years
'Satellite of                   Earth

'Physical characteristics

'Mean radius                    1737.10 km  (0.273 Earths)
'Equatorial radius              1738.14 km  (0.273 Earths)
'Polar radius                   1735.97 km  (0.273 Earths)
'Flattening                     0.001 25
'Circumference                  10921 km (equatorial)
'Surface area                   3.793 x 10^7 km  (0.074 Earths)
'Volume                         2.1958 x 10^10 km  (0.020 Earths)
'Mass                           7.3477 x 10^22 kg  (0.0123 Earths[1])
'Mean density                   3346.4 kg/m[1]
'Equatorial surface gravity     1.622 m/s (0.1654 g)
'Escape velocity                2380 m/s
'Sidereal rotation period       27.321582 d (synchronous)
'Equatorial rotation velocity   4.627 m/s
'Axial tilt                     1.5424 (to ecliptic)
'                               6.687 (to orbit plane)
'Albedo                         0.12
'Surface temp.                  min mean    max
'                   equator     100 K   220 K   390 K
'                   85N        70 K    130 K   230 K
'Apparent magnitude             -2.5 to -12.9
'                               -12.74 (mean full moon)
'Angular diameter               29.3 to 34.1 arcminutes

'---SUN-------------------------------------------------------------------------

'Orbital characteristics
'
'Mean distance from Milky Way core  ~2.5 x 10^20 m (26000 light-years)
'Galactic period                (2.252.50) x 10^8 a
'Velocity                       ~2.20 x 10^5 m/s (orbit around the center of the Galaxy)
'                               ~2 x 10^4 m/s (relative to average velocity of other stars in stellar neighborhood)

'Physical characteristics

'Mean diameter                  1.392 x 10^9 m (109 x Earth)
'Equatorial radius              6.955 x 10^8 m (109 x Earth)
'Equatorial circumference       4.379 x 10^9 m (109 x Earth)
'Flattening                     9 x 10^-6
'Surface area                   6.0877 x 10^18 m (11990 x Earth)
'Volume                         1.412 x 10^27 m (1300000 x Earth)
'Mass                           1.9891 x 10^30 kg (332900 x Earth)
'Average density                1.408 x 10^3 kg/m
'Different Densities
'           Core                1.5 x 10^5 kg/m
'           Lower Photosphere   2 x 10^-4 kg/m
'           Lower Cromosphere   5 x 10^-6 kg/m
'           Avg. Corona         1 x 10^-12 kg/m
'Equatorial surface gravity     274.0 m/s (27.94 g) (28 x Earth)
'Escape velocity from the surface  617700 m/s (55 x Earth)
'Temperature of surface (effective)  5778 K [1]
'Temperature of corona          ~5 x 10^6 K
'Temperature of core            ~15.7 x 10^6 K
'Luminosity (Lsol)              3.846 x 10^26 W
'                               ~3.75 x 10^28 lm
'                               ~98 lm/W efficacy
'Mean Intensity (Isol)          2.009 x 10^7 Wm-2sr-1

'Rotation characteristics

'Obliquity
'   to the ecliptic             7.25
'   to the galactic plane       67.23
'Right ascension
'   of North pole               286.13
'                               19h 4min 30s
'Declination
'   of North pole               +63.87
'                               6352' North
'Sidereal Rotation period
'   (at 16 latitude)           25.38 days [1]
'                               25d 9h 7min 13s [7]
'   (at equator)                25.05 days [1]
'   (at poles)                  34.3 days [1]
'Rotation velocity
'   (at equator)                7.189 x 10^3 km/h
