Expand description
A scale and an offset that transforms xyz coordinates.
Fields§
§scale: f64
The scale.
offset: f64
The offset.
Implementations§
source§impl Transform
impl Transform
sourcepub fn direct(&self, n: i32) -> f64
pub fn direct(&self, n: i32) -> f64
Applies this transform to an i32, returning a float.
Examples
use las::Transform;
let transform = Transform { scale: 2., offset: 1. };
assert_eq!(3., transform.direct(1));
sourcepub fn inverse(&self, n: f64) -> Result<i32>
pub fn inverse(&self, n: f64) -> Result<i32>
Applies the inverse transform, and rounds the result.
Returns an error if the resultant value can’t be represented as an i32.
Examples
use las::Transform;
let transform = Transform { scale: 2., offset: 1. };
assert_eq!(1, transform.inverse(2.9).unwrap());