Module raytracer

Class Vector3d

All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
PositionVector

public class Vector3d extends Vector3d
This class extends the javax.vecmath.Vector3d class and adds same rotation functions.
Author:
Ralf Kopsch
See Also:
  • Constructor Details

    • Vector3d

      public Vector3d()
      Creates a new Vector3D.
    • Vector3d

      public Vector3d(Tuple3d v)
      A copy constructor.
      Parameters:
      v - the vector to clone.
    • Vector3d

      public Vector3d(double x, double y, double z)
      A copy constructor.
      Parameters:
      x - the x-coordinate.
      y - the y-coordinate.
      z - the z-coordinate.
  • Method Details

    • rotateX

      public void rotateX(double sinTheta, double cosTheta)
      Rotates the vector around the x-axis.
      Parameters:
      sinTheta - the sinus angle.
      cosTheta - the cosinus angle.
    • rotateY

      public void rotateY(double sinTheta, double cosTheta)
      Rotates the vector around the y-axis.
      Parameters:
      sinTheta - the sinus angle.
      cosTheta - the cosinus angle.
    • rotateZ

      public void rotateZ(double sinTheta, double cosTheta)
      Rotates the vector around the z-axis.
      Parameters:
      sinTheta - the sinus angle.
      cosTheta - the cosinus angle.
    • calcRotationToZ

      public Vector3d.Theta calcRotationToZ()
      Pre calculates the rotation around the z axis.
      Returns:
      the calculated angles.
    • clone

      public Object clone()
      Overrides:
      clone in class Vector3d