pub struct Intrinsic2 {
pub start: Frame2,
pub curvature: CurvatureLaw,
pub length: Scalar,
}Expand description
A plane curve given by its natural equation: a curvature law anchored to a start frame and run for a finite arc length.
The frame supplies the rigid motion that k(s) alone cannot: its origin is the
curve start, and its x axis is the start tangent direction.
Like every other value in this crate, dirty imported data stays representable – a non-positive length is storable, and naming it is the job of a validator, not of the type.
Fields§
§start: Frame2Start frame: origin at the curve start, x along the start tangent.
curvature: CurvatureLawCurvature as a function of arc length from start.
length: ScalarArc length the law is defined over.
Implementations§
Source§impl Intrinsic2
impl Intrinsic2
Sourcepub const fn new(start: Frame2, curvature: CurvatureLaw, length: Scalar) -> Self
pub const fn new(start: Frame2, curvature: CurvatureLaw, length: Scalar) -> Self
Anchor a curvature law to a start frame over an arc length.
Sourcepub fn is_straight(&self) -> bool
pub fn is_straight(&self) -> bool
Whether the curve is a straight segment.
Sourcepub fn heading_at(&self, s: Scalar) -> Option<Scalar>
pub fn heading_at(&self, s: Scalar) -> Option<Scalar>
Tangent heading at arc length s from the start, in radians.
The integral of k over [0, s], which every law in the family has in
closed form – so the heading is exact even though the POSITION is not
and has to be quadratured. Measured from the start tangent, so the
absolute heading is this plus the start frame’s rotation.
Returns None when s is not finite or a piecewise law does not tile
[0, s], matching Self::total_turning.
Sourcepub fn total_turning(&self) -> Option<Scalar>
pub fn total_turning(&self) -> Option<Scalar>
Total tangent turning over the curve, in radians, in closed form.
This is the integral of k(s) over [0, length] – exact for every law in
the family, because each one has an elementary antiderivative. It is the
angle that integrates in closed form; position does not, which is why
this method exists and an evaluate does not.
Returns None when the length is not finite, since the integral is then
undefined rather than merely large.
Sourcepub fn turning_variation_bound(&self, s: Scalar) -> Option<Scalar>
pub fn turning_variation_bound(&self, s: Scalar) -> Option<Scalar>
Upper bound on the total variation of heading over [0, s], in radians.
total_turning is the SIGNED integral of k; over a zero-mean
oscillation it is zero however violently the curve wiggles. A quadrature
budget derived from it would then spend one panel on a curve that needs
many, so this returns the integral of |k| instead – or a bound on it.
Exact for Constant. For the other families an exact total variation
needs the sign changes of k, so this returns a cheap upper bound from
the triangle inequality: a bound is what a panel budget wants, and
overestimating costs panels while underestimating costs correctness.
None when s is not finite, matching heading_at.
Trait Implementations§
Source§impl Clone for Intrinsic2
impl Clone for Intrinsic2
Source§fn clone(&self) -> Intrinsic2
fn clone(&self) -> Intrinsic2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more