Example #1
0
        /**
         * Perpendicular bisector of two Pnts.
         * Works in any dimension.  The coefficients are returned as a Pnt of one
         * higher dimension (e.g., (A,B,C,D) for an equation of the form
         * Ax + By + Cz + D = 0).
         * @param point the other point
         * @return the coefficients of the perpendicular bisector
         */
        public Pnt bisector(Pnt point)
        {
            int    dim  = dimCheck(point);
            Pnt    diff = this.subtract(point);
            Pnt    sum  = this.add(point);
            double dot  = diff.dot(sum);

            return(diff.extend(new double[] { -dot / 2 }));
        }