lib/when_exe/ephemeris.rb in when_exe-0.4.4 vs lib/when_exe/ephemeris.rb in when_exe-0.4.5

- old
+ new

@@ -640,11 +640,11 @@ # @param [When::Coordinates::Spatial] loc 観測地 # # @return [When::Ephemeris::Coords] # def rh_to_h(t, loc) - rotate_y(loc.lat / (360.0*When::Coordinates::Spatial::DEGREE) - 0.25) + rotate_y(loc.lat / (360.0*loc.degree) - 0.25) end # 赤道座標 -> 地平座標 # # @param [Numeric] t ユリウス日(Terrestrial Time) @@ -653,11 +653,11 @@ # # @return [When::Ephemeris::Coords] # def r_to_h(t, loc) rotate_z(-loc.local_sidereal_time(t) / 24). - rotate_y(loc.lat / (360.0*When::Coordinates::Spatial::DEGREE) - 0.25) + rotate_y(loc.lat / (360.0*loc.degree) - 0.25) end # 球面の余弦 spherical law of cosines # # @param [When::Ephemeris::Coords] other @@ -1340,11 +1340,11 @@ # [ t が ユリウス日(Terrestrial Time) => ユリウス日(Terrestrial Time) ] # [ t が その他 => When::TM::DateAndTime ] # def day_event(t, event, target=When.Resource('_ep:Sun'), height=nil) # 時刻の初期値 - dl = @location.long / (360.0 * When::Coordinates::Spatial::DEGREE) + dl = @location.long / (360.0 * @location.degree) t0 = (+t + dl).round - dl dt = _coords(t0, When::Coordinates::Spatial::EQUATORIAL, target).phi - @location.local_sidereal_time(t0) / 24.0 + 0.25 * (event||0) t0 += dt - dt.round @@ -1524,12 +1524,12 @@ # def year_event(t, event, target, hs= @location.datum.zeros['A'], bs=nil) # difference of ecliptic longitude between zenith and target star # when the event happens pos = _coords(+t, When::Coordinates::Spatial::EQUATORIAL, target) - long = @location.long / When::Coordinates::Spatial::DEGREE - lat = @location.lat / When::Coordinates::Spatial::DEGREE + long = @location.long / @location.degree + lat = @location.lat / @location.degree dp = (sind(hs) - sind(lat) * sinc(pos.theta)) / (cosd(lat) * cosc(pos.theta)) return nil if dp.abs >= 1 dp = acos(dp) / CIRCLE @@ -1593,11 +1593,11 @@ # @lunation_1m = t = CYCLE_1M日 までの朔望月番号の比例定数 # @sun_0m = t = CYCLE_0M日 での太陽年番号 # @sun_1m = t = CYCLE_1M日 までの太陽年番号の比例定数 def _normalize(args=[], options={}) @location = When.Resource(@location, '_l:') if @location.kind_of?(String) - @long, @lat, @alt = [@location.long / When::Coordinates::Spatial::DEGREE, - @location.lat / When::Coordinates::Spatial::DEGREE, + @long, @lat, @alt = [@location.long / @location.degree, + @location.lat / @location.degree, @location.alt] if @location @formula ||= '1L' @time_standard ||= 'dynamical' @is_dynamical = (@time_standard[0..0].downcase == 'd')