pub struct CantLaw {
pub pieces: Vec<CantPiece>,
}Expand description
A scalar law over plan distance: pieces laid end to end from zero.
Piece i spans [sum of earlier lengths, + length_i); a seam belongs to
the piece that starts there, and the last piece is closed at its far end.
A distance before zero or past the last piece has no value: the law is
not extrapolated, because an extrapolated transition is not a cant
anyone authored.
Fields§
§pieces: Vec<CantPiece>Pieces in order of plan distance.
Implementations§
Source§impl CantLaw
impl CantLaw
Sourcepub fn zero(length: Scalar) -> Self
pub fn zero(length: Scalar) -> Self
Zero over length: the pivot law of a rotation about the
centreline.
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Whether every piece has a positive finite length and finite coefficients, and there is at least one piece.
Sourcepub fn has_angle_pieces(&self) -> bool
pub fn has_angle_pieces(&self) -> bool
Whether any piece gives a bank angle rather than a height.
Sourcepub fn has_rail_pieces(&self) -> bool
pub fn has_rail_pieces(&self) -> bool
Whether any piece rotates about a held rail
(CantForm::AboutRail), a pivot derived from the cant law.
Sourcepub fn value_at(&self, distance: Scalar) -> Option<CantValue>
pub fn value_at(&self, distance: Scalar) -> Option<CantValue>
Value at plan distance distance.
None when the law is malformed, distance is outside it, or the
piece there is a held-rail pivot (CantForm::AboutRail), whose
value comes from the cant law (Banked3::pivot_at).