pub struct Helmert { /* private fields */ }Expand description
Seven-parameter Helmert transformation between geocentric frames: translation, small rotation, scale.
Parameters come from EPSG, a national survey or a chart note, in one of two rotation sign conventions: position vector (rotates the point) and coordinate frame (rotates the axes; opposite sign). Each has its own constructor so parameters are entered as published.
The rotation matrix is the small-angle I + [r]× used by the definitions,
not an exact rotation: the published parameters were fitted with it.
Implementations§
Source§impl Helmert
impl Helmert
Sourcepub const fn translation(dx: f64, dy: f64, dz: f64) -> Self
pub const fn translation(dx: f64, dy: f64, dz: f64) -> Self
Translation only, metres: the three-parameter form most shifts are published in.
Sourcepub fn position_vector(
translation: [f64; 3],
rotation: [f64; 3],
scale_ppm: f64,
) -> Result<Self>
pub fn position_vector( translation: [f64; 3], rotation: [f64; 3], scale_ppm: f64, ) -> Result<Self>
Seven parameters, position vector convention (EPSG 9606, Bursa-Wolf as used in Europe): translations in m, rotations in arc-seconds, scale in ppm.
§Errors
KernelError::NotFinite for a non-finite parameter;
KernelError::OutOfRange for a scale ≤ −1 000 000 ppm (collapses the
frame).
Sourcepub fn coordinate_frame(
translation: [f64; 3],
rotation: [f64; 3],
scale_ppm: f64,
) -> Result<Self>
pub fn coordinate_frame( translation: [f64; 3], rotation: [f64; 3], scale_ppm: f64, ) -> Result<Self>
Seven parameters, coordinate frame convention (EPSG 9607, as used in the
US and Australia): as Helmert::position_vector with rotation signs
reversed.
§Errors
Sourcepub const fn translation_metres(&self) -> [f64; 3]
pub const fn translation_metres(&self) -> [f64; 3]
Translation, m.
Sourcepub const fn rotation_arc_seconds(&self) -> [f64; 3]
pub const fn rotation_arc_seconds(&self) -> [f64; 3]
Rotation, arc-seconds, position vector convention.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Whether every parameter is zero.
Sourcepub fn apply(&self, point: EcefPoint) -> EcefPoint
pub fn apply(&self, point: EcefPoint) -> EcefPoint
Forward transform: X′ = T + (1 + s) (I + [r]×) X.
Sourcepub fn apply_inverse(&self, point: EcefPoint) -> EcefPoint
pub fn apply_inverse(&self, point: EcefPoint) -> EcefPoint
Inverse transform, exact (not the usual sign-reversal approximation), so a round trip closes to rounding precision.
For M = I + [r]×, M⁻¹ = (I − [r]× + r rᵀ) / (1 + |r|²).