lib/kepler/orbit.rb
def universal_anomaly(dt)
      # initial guess of x
      x = Math.sqrt(@mu) * (dt / a);

      f = Proc.new { |x| UniversalFormulation.method(:f).call(x, a, @r, @v, @mu, dt) }
      df = Proc.new { |x| UniversalFormulation.method(:dfdt).call(x, a, @r, @v, @mu) }
      d2f = Proc.new { |x| UniversalFormulation.method(:d2fdt).call(x, a, @r, @v, @mu) }

      Laguerre.solve(x, f, df, d2f)
    end
# Find the Universal Anomaly by using Laguerre's method to find
# roots to Kepler's equation in terms of x at time dt
Find the Universal Anomaly by using Laguerre's method to find
roots to Kepler's equation in terms of x at time dt
Find the Universal Anomaly by using Laguerre ' s method to find roots to Kepler ' s equation in terms of x at time dt
def universal_anomaly(dt)
      x = Math.sqrt(@mu) * (dt / a);
      f = Proc.new { |x| UniversalFormulation.method(:f).call(x, a, @r, @v, @mu, dt) }
      df = Proc.new { |x| UniversalFormulation.method(:dfdt).call(x, a, @r, @v, @mu) }
      d2f = Proc.new { |x| UniversalFormulation.method(:d2fdt).call(x, a, @r, @v, @mu) }
      Laguerre.solve(x, f, df, d2f)
    end
def universal_anomaly ( dt ) x = Math . sqrt ( @mu ) * ( dt / a ) ; f = Proc . new { | x | UniversalFormulation . method ( :f ) . call ( x , a , @r , @v , @mu , dt ) } df = Proc . new { | x | UniversalFormulation . method ( :dfdt ) . call ( x , a , @r , @v , @mu ) } d2f = Proc . new { | x | UniversalFormulation . method ( :d2fdt ) . call ( x , a , @r , @v , @mu ) } Laguerre . solve ( x , f , df , d2f ) end
Find the Universal Anomaly by using Laguerre's method to find
roots to Kepler's equation in terms of x at time dt
Find the Universal Anomaly by using Laguerre ' s method to find roots to Kepler ' s equation in terms of x at time dt
# initial guess of x
dt