Class: Korba::KeplerEquationFunction

Inherits:
NewtonFunction show all
Includes:
OrbitUtils
Defined in:
lib/korba/kepler_equation_fucntion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OrbitUtils

#deg_to_rad, #distance, #eccentric_anomaly, #height_at_apogee, #height_at_perigee, #normalize_deg, #normalize_rad, #path_angle, #rad_to_deg, #semi_major_axis, #true_anomaly, #velocity

Methods inherited from NewtonFunction

#eps, #one, #ten, #two, #zero

Constructor Details

#initialize(eccentricity:, mean_anomaly:) ⇒ KeplerEquationFunction

Returns a new instance of KeplerEquationFunction.



10
11
12
13
14
# File 'lib/korba/kepler_equation_fucntion.rb', line 10

def initialize(eccentricity:, mean_anomaly:)
  super()
  @eccentricity = eccentricity
  @mean_anomaly = mean_anomaly
end

Instance Attribute Details

#eccentricityObject (readonly)

Returns the value of attribute eccentricity.



8
9
10
# File 'lib/korba/kepler_equation_fucntion.rb', line 8

def eccentricity
  @eccentricity
end

#mean_anomalyObject (readonly)

Returns the value of attribute mean_anomaly.



8
9
10
# File 'lib/korba/kepler_equation_fucntion.rb', line 8

def mean_anomaly
  @mean_anomaly
end

Instance Method Details

#values(x) ⇒ Object



16
17
18
# File 'lib/korba/kepler_equation_fucntion.rb', line 16

def values(x)
  [x[0] - eccentricity * Math.sin(x[0]) - deg_to_rad(mean_anomaly)]
end