Method: When::Ephemeris::Datum#phase_of_eclipse
- Defined in:
- lib/when_exe/ephemeris.rb
#phase_of_eclipse(t, target, base = Earth) ⇒ Numeric
食分
1122 1123 1124 1125 1126 1127 1128 |
# File 'lib/when_exe/ephemeris.rb', line 1122 def phase_of_eclipse(t, target, base=Earth) t = +t distance = acos(self.coords(t, base).spherical_law_of_cosines(target.coords(t, base))) / CIRCLE self_radius = self.apparent_radius(t, base) target_radius = target.apparent_radius(t, base) return (self_radius + target_radius - distance) / (2.0 * target_radius) end |