How it works
A Plane is defined by a unit normal vector and a scalar constant (d in nx·x + nz·z + d = 0). Move the mouse over the canvas to position a point. distanceTo(p) returns the signed distance — positive on the normal side, negative on the other. projectPoint(p) drops a perpendicular onto the plane surface (dashed line).