Merge pull request #120 from jeannekamikaze/master

Create Plane from point and normal.
This commit is contained in:
kvark 2014-08-26 12:00:29 -04:00
commit 2163d7b0a5

View file

@ -89,6 +89,12 @@ impl<S: BaseFloat> Plane<S> {
Some(Plane::new(n, d))
}
}
/// Construct a plane from a point and a normal vector.
/// The plane will contain the point `p` and be perpendicular to `n`.
pub fn from_point_normal(p: Point3<S>, n: Vector3<S>) -> Plane<S> {
Plane { n: n, d: p.dot(&n) }
}
}
impl<S: BaseFloat> Intersect<Option<Point3<S>>> for (Plane<S>, Ray3<S>) {