#[non_exhaustive]pub enum CantForm {
Polynomial {
coefficients: Vec<f64>,
},
Cosine {
start: f64,
change: f64,
},
Sine {
start: f64,
change: f64,
},
VienneseBend {
start: f64,
change: f64,
},
AboutRail {
rail: RailSide,
elevation: f64,
},
}Expand description
The shape of one cant piece over its own xi = s / length in [0, 1].
Height forms give the cant D (the left rail head above the right) in
length units; the angle form gives the bank angle psi in radians.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Polynomial
D(xi) = coefficients[0] + coefficients[1] xi + coefficients[2] xi^2 + ...
Covers a constant cant (degree 0), a linear transition (degree 1),
the Bloss transition D1 + dD (3 - 2 xi) xi^2 (degree 3) and each
half of a Helmert transition (degree 2; see CantPiece::helmert).
An empty list is zero.
Cosine
D(xi) = start + change (1 - cos(pi xi)) / 2: the half-cosine
transition, tangent to its neighbours’ slopes at both ends.
Sine
D(xi) = start + change (xi - sin(2 pi xi) / (2 pi)): the sine
transition, whose slope AND curvature vanish at both ends.
VienneseBend
psi(xi) = start + change xi^4 (35 - 84 xi + 70 xi^2 - 20 xi^3): the
Viennese bend, written for the bank angle itself. Its first three
derivatives vanish at both ends. The cant follows as b sin(psi).
Fields
AboutRail
A pivot piece rotating about the held rail (#279):
e = elevation + s (b / 2) sin(psi) = elevation + s D / 2, D and
psi the cant law’s at the same plan distance, s = +1 about the
right rail and -1 about the left. See the
module docs.
Derived, not a law of xi: CantLaw::value_at has no value for
it and Banked3::pivot_at reads it. Refused in a cant law.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CantForm
impl<'de> Deserialize<'de> for CantForm
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CantForm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CantForm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for CantForm
impl Serialize for CantForm
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CantForm
Auto Trait Implementations§
impl Freeze for CantForm
impl RefUnwindSafe for CantForm
impl Send for CantForm
impl Sync for CantForm
impl Unpin for CantForm
impl UnsafeUnpin for CantForm
impl UnwindSafe for CantForm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more