Point3D

Type Alias Point3D 

Source
pub type Point3D = Vec3;
Expand description

Represents a 3D point in space.

Alias for Vec3.

Aliased Type§

pub struct Point3D {
    pub x: f64,
    pub y: f64,
    pub z: f64,
}

Fields§

§x: f64

X component of the vector.

§y: f64

Y component of the vector.

§z: f64

Z component of the vector.

Implementations§

Source§

impl Point3D

Source

pub fn dist(&self, other: &Point3D) -> f64

Finds the unsigned distance between self and another 3D point Other.

#examples

use lars::{Point3D};
let a = Point3D::new(1.0, 0.0, 0.0);
let b = Point3D::new(0.0, 0.0, 0.0);
assert_eq!(a.dist(&b), 1.0)
Source

pub fn dist_sq(&self, other: &Point3D) -> f64

Finds the unsigned distance between self and another 3D point Other, squared

#examples


use lars::Point3D;
let a = Point3D::new(2.0, 0.0, 0.0);
let b = Point3D::new(0.0, 0.0, 0.0);
assert_eq!(a.dist_sq(&b), 4.0)