Here you can find the source of distancePointToPlane(final double x0, final double y0, final double z0, final double[] normal, final double xp, final double yp, final double zp)
Parameter | Description |
---|---|
x0 | any point that lies on the plane |
y0 | any point that lies on the plane |
z0 | any point that lies on the plane |
normal | the normal to the plane |
xp | the other point |
yp | the other point |
zp | the other point |
public static double distancePointToPlane(final double x0, final double y0, final double z0, final double[] normal, final double xp, final double yp, final double zp)
//package com.java2s; public class Main { /**/*from w w w . ja v a 2 s .co m*/ * Compute the distance to a plane from a point. * * @param x0 any point that lies on the plane * @param y0 any point that lies on the plane * @param z0 any point that lies on the plane * @param normal the normal to the plane * @param xp the other point * @param yp the other point * @param zp the other point * @return the signed distance from the point to the plane. */ public static double distancePointToPlane(final double x0, final double y0, final double z0, final double[] normal, final double xp, final double yp, final double zp) { double x = xp - x0; double y = yp - y0; double z = zp - z0; return normal[0] * x + normal[1] * y + normal[2] * z; } }