Method: OpenC3::SegmentedPolynomialConversion#add_segment

Defined in:
lib/openc3/conversions/segmented_polynomial_conversion.rb

#add_segment(lower_bound, *coeffs) ⇒ Object

Add a segment to the segmented polynomial. The lower bound is inclusive, but is ignored for the segment with the lowest lower_bound.

Parameters:

  • lower_bound (Integer)

    The value at which point this polynomial conversion should apply. All values >= to this value will be converted using the given coefficients.

  • coeffs (Array<Integer>)

    The polynomial coefficients



109
110
111
112
# File 'lib/openc3/conversions/segmented_polynomial_conversion.rb', line 109

def add_segment(lower_bound, *coeffs)
  @segments << Segment.new(lower_bound, coeffs)
  @segments.sort!
end