Package primitives

Class NormalizedVector

java.lang.Object

public class NormalizedVector
extends NonZeroVector
This class represents a special kind of NonZeroVector whose length is one.
  • Field Details

  • Constructor Details

    • NormalizedVector

      public NormalizedVector​(NonZeroVector vector)
      Constructs a NormalizedVector from a not necessarily normalized NonZeroVector
      Parameters:
      vector - The unnormalized vector.
    • NormalizedVector

      public NormalizedVector​(double x, double y, double z)
      This constructor accepts 3 doubles and returns the appropriate NonZeroVector.
      Parameters:
      x - The value of the x coordinate.
      y - The value of the y coordinate.
      z - The value of the z coordinate.
      Throws:
      ZeroVectorException - if the x, y, and z are all zero.
  • Method Details