#[non_exhaustive]pub enum CantForm {
Polynomial {
coefficients: Vec<Scalar>,
},
Cosine {
start: Scalar,
change: Scalar,
},
Sine {
start: Scalar,
change: Scalar,
},
VienneseBend {
start: Scalar,
change: Scalar,
},
AboutRail {
rail: RailSide,
elevation: Scalar,
},
}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.