Example #1
0
 public static function Calculate_Solar_Position($time, Predict_Vector $solar_vector)
 {
     $mjd = $time - 2415020.0;
     $year = 1900 + $mjd / 365.25;
     $T = ($mjd + Predict_Time::Delta_ET($year) / Predict::secday) / 36525.0;
     $M = Predict_Math::Radians(Predict_Math::Modulus(358.47583 + Predict_Math::Modulus(35999.04975 * $T, 360.0) - (0.00015 + 3.3E-6 * $T) * ($T * $T), 360.0));
     $L = Predict_Math::Radians(Predict_Math::Modulus(279.69668 + Predict_Math::Modulus(36000.76892 * $T, 360.0) + 0.0003025 * ($T * $T), 360.0));
     $e = 0.01675104 - (4.18E-5 + 1.26E-7 * $T) * $T;
     $C = Predict_Math::Radians((1.91946 - (0.004789 + 1.4E-5 * $T) * $T) * sin($M) + (0.020094 - 0.0001 * $T) * sin(2 * $M) + 0.000293 * sin(3 * $M));
     $O = Predict_Math::Radians(Predict_Math::Modulus(259.18 - 1934.142 * $T, 360.0));
     $Lsa = Predict_Math::Modulus($L + $C - Predict_Math::Radians(0.00569 - 0.00479 * sin($O)), Predict::twopi);
     $nu = Predict_Math::Modulus($M + $C, Predict::twopi);
     $R = 1.0000002 * (1 - $e * $e) / (1 + $e * cos($nu));
     $eps = Predict_Math::Radians(23.452294 - (0.0130125 + (1.64E-6 - 5.03E-7 * $T) * $T) * $T + 0.00256 * cos($O));
     $R = Predict::AU * $R;
     $solar_vector->x = $R * cos($Lsa);
     $solar_vector->y = $R * sin($Lsa) * cos($eps);
     $solar_vector->z = $R * sin($Lsa) * sin($eps);
     $solar_vector->w = $R;
 }