pub struct Banked3 {
pub base: Elevated3,
pub cant: CantLaw,
pub pivot: CantLaw,
pub rail_head_distance: f64,
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: f64Rail-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: f64,
convention: BankConvention,
) -> Banked3
pub const fn new( base: Elevated3, cant: CantLaw, pivot: CantLaw, rail_head_distance: f64, convention: BankConvention, ) -> Banked3
Pair a centreline with cant and pivot laws under a named convention.
Sourcepub fn cant_at(&self, distance: f64) -> Result<f64, BankError>
pub fn cant_at(&self, distance: f64) -> Result<f64, 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: f64) -> Result<f64, BankError>
pub fn bank_angle_at(&self, distance: f64) -> Result<f64, 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: f64) -> Result<(f64, f64), BankError>
pub fn pivot_at(&self, distance: f64) -> Result<(f64, f64), 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).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Banked3
impl<'de> Deserialize<'de> for Banked3
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Banked3, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Banked3, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Banked3
impl Serialize for Banked3
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 Banked3
Auto Trait Implementations§
impl Freeze for Banked3
impl RefUnwindSafe for Banked3
impl Send for Banked3
impl Sync for Banked3
impl Unpin for Banked3
impl UnsafeUnpin for Banked3
impl UnwindSafe for Banked3
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