pub enum Motion {
Drift {
velocity: VelocityVec,
},
Oscillate {
amplitude: LengthVec,
frequency: Frequency,
phase_deg: f64,
},
Spin {
axis: DVec3,
pivot: LengthVec,
rate_deg_per_s: f64,
},
}Expand description
Rigid motion of one element, assembly or source.
Variants§
Drift
Constant velocity: a conveyor belt, a translation stage, or the drift of a star field across an untracked telescope.
Fields
velocity: VelocityVecHow fast and which way.
Oscillate
Sinusoidal displacement about the authored position, which is the centre of
the swing. amplitude carries both size and direction, so a floor
vibration and an axial focus dither are the same variant.
Fields
Spin
Rotation at rate_deg_per_s about axis through pivot. A rotating stage
or a scanning mirror: it turns what it carries as well as moving it, so an
element’s own axis tilts too.
Implementations§
Source§impl Motion
impl Motion
Sourcepub fn rotation_at(&self, t: Time) -> DQuat
pub fn rotation_at(&self, t: Time) -> DQuat
The rotation this motion has accumulated by time t. Identity for the
purely translational variants.
Sourcepub fn move_point(&self, p: LengthVec, t: Time) -> LengthVec
pub fn move_point(&self, p: LengthVec, t: Time) -> LengthVec
Where a point authored at p sits at time t.
Sourcepub fn turn(&self, d: DVec3, t: Time) -> DVec3
pub fn turn(&self, d: DVec3, t: Time) -> DVec3
Where a direction authored as d points at time t. A direction is
dimensionless, and translation does not change it.
Sourcepub fn velocity_at(&self, p: LengthVec, t: Time) -> VelocityVec
pub fn velocity_at(&self, p: LengthVec, t: Time) -> VelocityVec
Velocity of the point authored at p, at time t.
Differentiated in closed form rather than by finite difference, so it is exact — which matters because this is what sets a motion-blur streak length and what a Doppler shift would be computed from.