#[non_exhaustive]pub enum BankConvention {
TangentRotation,
VerticalRise,
}Expand description
Which height difference a cant D states on a grade (ADR 0081).
See the module docs for both frames. No variant is a default:
a Banked3 names one.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TangentRotation
The level-track section turned about the 3D tangent by
psi = asin(D / b). The rail heads differ in height by
D cos(theta) at grade angle theta.
VerticalRise
The section rolled about the 3D tangent by asin(D / (b cos theta)),
so the rail heads, b apart square to the tangent, differ in height
by exactly D.
Implementations§
Source§impl BankConvention
impl BankConvention
Sourcepub fn roll(
self,
cant: Scalar,
rail_head_distance: Scalar,
grade_cosine: Scalar,
) -> Result<Scalar, BankError>
pub fn roll( self, cant: Scalar, rail_head_distance: Scalar, grade_cosine: Scalar, ) -> Result<Scalar, BankError>
The roll about the tangent, in radians, for cant cant over
rail-head distance rail_head_distance at a grade whose angle has
cosine grade_cosine.
§Errors
BankError::RailHeadDistance for a non-positive or non-finite
b; BankError::CantExceedsRailHeadDistance when |D| > b;
BankError::CantExceedsVerticalSpan when, under
VerticalRise, |D| > b cos(theta);
BankError::NonFinite for a non-finite cant or cosine.
Sourcepub fn roll_from_angle(
self,
psi: Scalar,
rail_head_distance: Scalar,
grade_cosine: Scalar,
) -> Result<Scalar, BankError>
pub fn roll_from_angle( self, psi: Scalar, rail_head_distance: Scalar, grade_cosine: Scalar, ) -> Result<Scalar, BankError>
roll from a nominal bank angle psi with
sin(psi) = D / b, as an angle-form piece gives it.
Under TangentRotation this is psi
itself, with no round trip through the cant.
§Errors
As roll, and BankError::AngleOutOfRange for
|psi| > pi / 2, which no cant gives.
Trait Implementations§
Source§impl Clone for BankConvention
impl Clone for BankConvention
Source§fn clone(&self) -> BankConvention
fn clone(&self) -> BankConvention
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more