Class JavaPoint3D

    • Constructor Detail

      • JavaPoint3D

        public JavaPoint3D​(double x,
                           double y)
      • JavaPoint3D

        public JavaPoint3D​(double x,
                           double y,
                           double z)
    • Method Detail

      • sub

        public JavaPoint3D sub​(JavaPoint3D vector)
        Subtracts the given JavaPoint from this.
        Specified by:
        sub in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        vector - The JavaPoint to be subtracted from this
        Returns:
        A new instance holding the result of the vector subtraction
      • add

        public JavaPoint3D add​(JavaPoint3D vector)
        Adds the given JavaPoint to this.
        Specified by:
        add in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        vector - The JavaPoint to be added to this
        Returns:
        A new instance holding the result of the vector addition
      • mult

        public JavaPoint3D mult​(double scalar)
        Multiplies this by the given scalar.
        Specified by:
        mult in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        scalar - The scalar to be multiplied by this
        Returns:
        A new instance holding the result of the multiplication
      • mult

        public JavaPoint3D mult​(JavaPoint3D vector)
        Multiplies this by the given vector.
        Specified by:
        mult in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        vector - The vector to be multiplied by this
        Returns:
        A new instance holding the result of the multiplication
      • div

        public JavaPoint3D div​(double scalar)
        Divides this by the given scalar.
        Specified by:
        div in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        scalar - The scalar to by which this should be divided
        Returns:
        A new instance holding the result of the division
      • dot

        public double dot​(JavaPoint3D vector)
        Computes the dot product of this and the given JavaPoint.
        Specified by:
        dot in class AbstractJavaPoint<JavaPoint3D>
        Parameters:
        vector - The JavaPoint to be multiplied by this
        Returns:
        A new instance holding the result of the multiplication
      • rotate

        public JavaPoint3D rotate​(double roll,
                                  double pitch,
                                  double yaw)
        Rotates the point around the origin (0,0,0)
        Parameters:
        roll - Rotation around x-axis (in degrees)
        pitch - Rotation around y-axis (in degrees)
        yaw - Rotation around z-axis (in degrees)
        Returns:
        Returns a new, rotated instance
      • crossProduct

        public JavaPoint3D crossProduct​(JavaPoint3D b)
        Parameters:
        b - the second vector
        Returns:
        the cross product c = a x b, where a == this
      • rotate

        public JavaPoint3D rotate​(JavaPoint3D origin,
                                  double roll,
                                  double pitch,
                                  double yaw)
        Rotates the point around the given origin
        Parameters:
        origin - origin point around which will be rotated.
        roll - Rotation around x-axis (in degrees)
        pitch - Rotation around y-axis (in degrees)
        yaw - Rotation around z-axis (in degrees)
        Returns:
        Returns a new, rotated instance