#[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: f64,
rail_head_distance: f64,
grade_cosine: f64,
) -> Result<f64, BankError>
pub fn roll( self, cant: f64, rail_head_distance: f64, grade_cosine: f64, ) -> Result<f64, 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: f64,
rail_head_distance: f64,
grade_cosine: f64,
) -> Result<f64, BankError>
pub fn roll_from_angle( self, psi: f64, rail_head_distance: f64, grade_cosine: f64, ) -> Result<f64, 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 moreimpl Copy for BankConvention
Source§impl Debug for BankConvention
impl Debug for BankConvention
Source§impl<'de> Deserialize<'de> for BankConvention
impl<'de> Deserialize<'de> for BankConvention
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BankConvention, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BankConvention, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for BankConvention
Source§impl Hash for BankConvention
impl Hash for BankConvention
Source§impl PartialEq for BankConvention
impl PartialEq for BankConvention
Source§impl Serialize for BankConvention
impl Serialize for BankConvention
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 BankConvention
Auto Trait Implementations§
impl Freeze for BankConvention
impl RefUnwindSafe for BankConvention
impl Send for BankConvention
impl Sync for BankConvention
impl Unpin for BankConvention
impl UnsafeUnpin for BankConvention
impl UnwindSafe for BankConvention
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