pub struct Banked3 {
pub base: Elevated3,
pub cant: CantLaw,
pub pivot: CantLaw,
pub rail_head_distance: Scalar,
pub convention: BankConvention,
}Expand description
A centreline with a roll law: the composition a canted track is authored as. See the module docs.
Evaluated by PLAN distance d, like its base. The point is
base(d) + pivot(d) z; the section frame is rolled about that point’s
own unit tangent by the angle convention gives.
The curve’s span is the cant law’s: no station outside it has a section.
Fields§
§base: Elevated3Centreline: plan and vertical profile.
cant: CantLawCant D(d) (left rail head above right), or bank angle, by piece.
pivot: CantLawElevation e(d) of the rotation point above the profile: height
pieces, or held-rail pieces derived from the cant
(CantForm::AboutRail). No angle pieces.
rail_head_distance: ScalarRail-head distance b, from which psi = asin(D / b).
convention: BankConventionWhich height difference D states on a grade.
Implementations§
Source§impl Banked3
impl Banked3
Sourcepub const fn new(
base: Elevated3,
cant: CantLaw,
pivot: CantLaw,
rail_head_distance: Scalar,
convention: BankConvention,
) -> Self
pub const fn new( base: Elevated3, cant: CantLaw, pivot: CantLaw, rail_head_distance: Scalar, convention: BankConvention, ) -> Self
Pair a centreline with cant and pivot laws under a named convention.
Sourcepub fn cant_at(&self, distance: Scalar) -> Result<Scalar, BankError>
pub fn cant_at(&self, distance: Scalar) -> Result<Scalar, BankError>
Cant D at distance: the law’s height, or b sin(psi) for an
angle piece.
§Errors
BankError::OutsideLaw off the law, BankError::RailHeadDistance
for a bad b, and the angle checks of bank_angle_at.
Sourcepub fn bank_angle_at(&self, distance: Scalar) -> Result<Scalar, BankError>
pub fn bank_angle_at(&self, distance: Scalar) -> Result<Scalar, BankError>
Nominal bank angle psi = asin(D / b) at distance; an angle piece
gives it directly.
§Errors
BankError::CantExceedsRailHeadDistance when |D| > b,
BankError::AngleOutOfRange for an angle piece beyond a quarter
turn, BankError::OutsideLaw off the law.
Sourcepub fn pivot_at(&self, distance: Scalar) -> Result<(Scalar, Scalar), BankError>
pub fn pivot_at(&self, distance: Scalar) -> Result<(Scalar, Scalar), BankError>
Elevation e of the rotation point above the profile at distance,
and its rate per unit plan distance.
A held-rail piece (CantForm::AboutRail) derives both from the
cant law: e = e0 + s D / 2 and e' = s D' / 2, which for an angle
piece are e0 + s (b / 2) sin(psi) and s (b / 2) cos(psi) psi'.
§Errors
BankError::AngleInPivot for a pivot law with an angle piece,
BankError::OutsideLaw off the law; for a held-rail piece, the
cant law’s refusals at distance (cant_at).