x = $R * cos($Lsa); $solar_vector->y = $R * sin($Lsa) * cos($eps); $solar_vector->z = $R * sin($Lsa) * sin($eps); $solar_vector->w = $R; } /* Calculates stellite's eclipse status and depth */ public static function Sat_Eclipsed(Predict_Vector $pos, Predict_Vector $sol, &$depth) { $Rho = new Predict_Vector(); $earth = new Predict_Vector(); /* Determine partial eclipse */ $sd_earth = Predict_Math::ArcSin(Predict::xkmper / $pos->w); Predict_Math::Vec_Sub($sol, $pos, $Rho); $sd_sun = Predict_Math::ArcSin(Predict::__sr__ / $Rho->w); Predict_Math::Scalar_Multiply(-1, $pos, $earth); $delta = Predict_Math::Angle($sol, $earth); $depth = $sd_earth - $sd_sun - $delta; if ($sd_earth < $sd_sun) { return 0; } else if ($depth >= 0) { return 1; } else { return 0; } } /** * Finds the current location of the sun based on the observer location * * @param Predict_QTH $qth The observer location * @param int $daynum The daynum or null to use the current daynum * * @return Predict_ObsSet */ public static function FindSun(Predict_QTH $qth, $daynum = null) { if ($daynum === null) { $daynum = Predict_Time::get_current_daynum(); } $obs_geodetic = new Predict_Geodetic(); $obs_geodetic->lon = $qth->lon * Predict::de2ra; $obs_geodetic->lat = $qth->lat * Predict::de2ra; $obs_geodetic->alt = $qth->alt / 1000.0; $obs_geodetic->theta = 0; $solar_vector = new Predict_Vector(); $zero_vector = new Predict_Vector(); $solar_set = new Predict_ObsSet(); self::Calculate_Solar_Position($daynum, $solar_vector); Predict_SGPObs::Calculate_Obs( $daynum, $solar_vector, $zero_vector, $obs_geodetic, $solar_set ); $solar_set->az = Predict_Math::Degrees($solar_set->az); $solar_set->el = Predict_Math::Degrees($solar_set->el); return $solar_set; } }