pub struct TrajectoryData<const N: usize> { /* private fields */ }Expand description
Generic interpolated time series data with N components.
Implementations§
Source§impl<const N: usize> TrajectoryData<N>
impl<const N: usize> TrajectoryData<N>
Sourcepub fn from_arrays<const M: usize>(
epoch: TimeDelta,
time_steps: [TimeDelta; M],
data: &[[f64; M]; N],
) -> Self
pub fn from_arrays<const M: usize>( epoch: TimeDelta, time_steps: [TimeDelta; M], data: &[[f64; M]; N], ) -> Self
Creates trajectory data from fixed-size arrays of time steps and component data.
Sourcepub fn time_steps(&self) -> Arc<[f64]>
pub fn time_steps(&self) -> Arc<[f64]>
Returns the time steps relative to the epoch in seconds.
Sourcepub fn interpolate<const M: usize>(&self, t: f64) -> f64
pub fn interpolate<const M: usize>(&self, t: f64) -> f64
Interpolates the M-th component at time t (seconds since epoch).
Sourcepub fn interpolate_all(&self, t: f64) -> [f64; N]
pub fn interpolate_all(&self, t: f64) -> [f64; N]
Interpolates all N components at time t (seconds since epoch).
Source§impl TrajectoryData<6>
impl TrajectoryData<6>
Sourcepub fn from_states(
states: impl IntoIterator<Item = TimeStampedCartesian>,
) -> Self
pub fn from_states( states: impl IntoIterator<Item = TimeStampedCartesian>, ) -> Self
Creates a trajectory from an iterator of timestamped Cartesian states.
Sourcepub fn interpolate_x(&self, t: f64) -> f64
pub fn interpolate_x(&self, t: f64) -> f64
Interpolates the x position at time t (seconds since epoch).
Sourcepub fn interpolate_y(&self, t: f64) -> f64
pub fn interpolate_y(&self, t: f64) -> f64
Interpolates the y position at time t (seconds since epoch).
Sourcepub fn interpolate_z(&self, t: f64) -> f64
pub fn interpolate_z(&self, t: f64) -> f64
Interpolates the z position at time t (seconds since epoch).
Sourcepub fn interpolate_vx(&self, t: f64) -> f64
pub fn interpolate_vx(&self, t: f64) -> f64
Interpolates the x velocity at time t (seconds since epoch).
Sourcepub fn interpolate_vy(&self, t: f64) -> f64
pub fn interpolate_vy(&self, t: f64) -> f64
Interpolates the y velocity at time t (seconds since epoch).
Sourcepub fn interpolate_vz(&self, t: f64) -> f64
pub fn interpolate_vz(&self, t: f64) -> f64
Interpolates the z velocity at time t (seconds since epoch).
Sourcepub fn position(&self, t: f64) -> DVec3
pub fn position(&self, t: f64) -> DVec3
Interpolates the position vector at time t (seconds since epoch).
Trait Implementations§
Source§impl<const N: usize> Clone for TrajectoryData<N>
impl<const N: usize> Clone for TrajectoryData<N>
Source§fn clone(&self) -> TrajectoryData<N>
fn clone(&self) -> TrajectoryData<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more