Class: Ephem::Segments::PositionGroup
- Inherits:
-
SegmentGroup
- Object
- SegmentGroup
- Ephem::Segments::PositionGroup
- Defined in:
- lib/ephem/segments/position_group.rb
Overview
The position segments for one SPK center/target pair. Routes each query to the segment covering the requested time. Returned by SPK#[].
Instance Attribute Summary
Attributes inherited from SegmentGroup
Instance Method Summary collapse
-
#center ⇒ Integer
The center body ID.
-
#compute(tdb, tdb2 = 0.0) ⇒ Core::Vector+
(also: #position_at)
Position at the given time.
-
#compute_and_differentiate(tdb, tdb2 = 0.0) ⇒ Core::State+
(also: #state_at)
Position and velocity at the given time.
-
#target ⇒ Integer
The target body ID.
Methods inherited from SegmentGroup
#clear_data, #initialize, #to_s, wrap
Constructor Details
This class inherits a constructor from Ephem::Segments::SegmentGroup
Instance Method Details
#center ⇒ Integer
Returns the center body ID.
11 12 13 |
# File 'lib/ephem/segments/position_group.rb', line 11 def center @segments.first.center end |
#compute(tdb, tdb2 = 0.0) ⇒ Core::Vector+ Also known as: position_at
Position at the given time. See Segment#compute.
25 26 27 28 29 |
# File 'lib/ephem/segments/position_group.rb', line 25 def compute(tdb, tdb2 = 0.0) query(tdb, tdb2) do |segment, time, fraction| segment.compute(time, fraction) end end |
#compute_and_differentiate(tdb, tdb2 = 0.0) ⇒ Core::State+ Also known as: state_at
Position and velocity at the given time. See Segment#compute_and_differentiate.
38 39 40 41 42 |
# File 'lib/ephem/segments/position_group.rb', line 38 def compute_and_differentiate(tdb, tdb2 = 0.0) query(tdb, tdb2) do |segment, time, fraction| segment.compute_and_differentiate(time, fraction) end end |
#target ⇒ Integer
Returns the target body ID.
16 17 18 |
# File 'lib/ephem/segments/position_group.rb', line 16 def target @segments.first.target end |