Class Point3d

    • Constructor Detail

      • Point3d

        public Point3d()
        Construct a zero point.
      • Point3d

        public Point3d​(Tuple3D<?> tuple)
        Constructor.
        Parameters:
        tuple - is the tuple to copy.
      • Point3d

        public Point3d​(int[] tuple)
        Constructor.
        Parameters:
        tuple - is the tuple to copy.
      • Point3d

        public Point3d​(double[] tuple)
        Constructor.
        Parameters:
        tuple - is the tuple to copy.
      • Point3d

        public Point3d​(int x,
                       int y,
                       int z)
        Construct a point with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Point3d

        public Point3d​(float x,
                       float y,
                       float z)
        Construct a point with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Point3d

        public Point3d​(double x,
                       double y,
                       double z)
        Construct a point with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Point3d

        public Point3d​(long x,
                       long y,
                       long z)
        Construct a point with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
    • Method Detail

      • convert

        public static Point3d convert​(Tuple3D<?> tuple)
        Convert the given tuple to a real Point3d.

        If the given tuple is already a Point3d, it is replied.

        Parameters:
        tuple - the tuple.
        Returns:
        the Point3d.
        Since:
        14.0
      • getDistanceSquared

        @Pure
        public double getDistanceSquared​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the square of the distance between this point and point p1.
        Specified by:
        getDistanceSquared in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • getDistance

        @Pure
        public double getDistance​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the distance between this point and point p1.
        Specified by:
        getDistance in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • getDistanceL1

        @Pure
        public double getDistanceL1​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).
        Specified by:
        getDistanceL1 in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • getDistanceLinf

        @Pure
        public double getDistanceLinf​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].
        Specified by:
        getDistanceLinf in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • getIdistanceL1

        @Pure
        public int getIdistanceL1​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2) + abs(z1-z2).
        Specified by:
        getIdistanceL1 in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • getIdistanceLinf

        @Pure
        public int getIdistanceLinf​(Point3D<?,​?> pt)
        Description copied from interface: Point3D
        Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].
        Specified by:
        getIdistanceLinf in interface Point3D<Point3d,​Vector3d>
        Parameters:
        pt - the other point
        Returns:
        the distance.
      • add

        public void add​(Point3D<?,​?> point,
                        Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the sum of tuples t1 and t2.
        Specified by:
        add in interface Point3D<Point3d,​Vector3d>
        Parameters:
        point - the first tuple
        vector - the second tuple
      • add

        public void add​(Vector3D<?,​?> vector,
                        Point3D<?,​?> point)
        Description copied from interface: Point3D
        Sets the value of this tuple to the sum of tuples t1 and t2.
        Specified by:
        add in interface Point3D<Point3d,​Vector3d>
        Parameters:
        vector - the second tuple
        point - the first tuple
      • add

        public void add​(Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the sum of itself and t1.
        Specified by:
        add in interface Point3D<Point3d,​Vector3d>
        Parameters:
        vector - the other tuple
      • scaleAdd

        public void scaleAdd​(int scale,
                             Vector3D<?,​?> vector,
                             Point3D<?,​?> point)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        vector - the tuple to be multipled
        point - the tuple to be added
      • scaleAdd

        public void scaleAdd​(double scale,
                             Vector3D<?,​?> vector,
                             Point3D<?,​?> point)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        vector - the tuple to be multipled
        point - the tuple to be added
      • scaleAdd

        public void scaleAdd​(int scale,
                             Point3D<?,​?> point,
                             Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        point - the tuple to be multipled
        vector - the tuple to be added
      • scaleAdd

        public void scaleAdd​(double scale,
                             Point3D<?,​?> point,
                             Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        point - the tuple to be multipled
        vector - the tuple to be added
      • scaleAdd

        public void scaleAdd​(int scale,
                             Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        vector - the tuple to be added
      • scaleAdd

        public void scaleAdd​(double scale,
                             Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
        Specified by:
        scaleAdd in interface Point3D<Point3d,​Vector3d>
        Parameters:
        scale - the scalar value
        vector - the tuple to be added
      • sub

        public void sub​(Point3D<?,​?> point,
                        Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).
        Specified by:
        sub in interface Point3D<Point3d,​Vector3d>
        Parameters:
        point - the first tuple
        vector - the second tuple
      • sub

        public void sub​(Vector3D<?,​?> vector)
        Description copied from interface: Point3D
        Sets the value of this tuple to the difference of itself and t1 (this = this - t1).
        Specified by:
        sub in interface Point3D<Point3d,​Vector3d>
        Parameters:
        vector - the other tuple