Search code examples
mathvector

signed distance between plane and point


I cannot find a consistent method for finding the signed distance between a point and a plane. How can I calculate this given a plane defined as a point and a normal?

struct Plane
{
    Vec3 point;
    Vec3 normal;
} 

Solution

  • You're making things much too complicated. If your normal is normalized, you can just do this:

    float dist = dotProduct(p.normal, (vectorSubtract(point, p.point)));