com.orsoncharts.graphics3d

## Class Point3D

- java.lang.Object
- - com.orsoncharts.graphics3d.Point3D

- All Implemented Interfaces:
    java.io.Serializable

      public final class Point3D
      extends java.lang.Object
      implements java.io.Serializable

  A point in 3D space (this class is also used to represent vectors in 3D space). Instances of this class are immutable.
  NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Point3D` | `ORIGIN` The origin `(0, 0, 0)`.
    `static Point3D` | `UNIT_X` The point `(1, 0, 0)`.
    `static Point3D` | `UNIT_Y` The point `(0, 1, 0)`.
    `static Point3D` | `UNIT_Z` The point `(0, 0, 1)`.
    `double` | `x` The x-coordinate.
    `double` | `y` The y-coordinate.
    `double` | `z` The z-coordinate.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Point3D(double x, double y, double z)` Creates a new point in 3D space.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Point3D` | `createPoint3D(double theta, double phi, double rho)` Creates a new `Point3D` instance from spherical coordinates.
    `boolean` | `equals(java.lang.Object obj)` Tests this instance for equality to an arbitrary object.
    `double` | `getPhi()` Returns phi (calculated from the cartesian coordinates).
    `double` | `getRho()` Returns rho (calculated from the cartesian coordinates).
    `double` | `getTheta()` Returns theta (calculated from the cartesian coordinates).
    `double` | `getX()` Returns the x-coordinate specified in the constructor.
    `double` | `getY()` Returns the y-coordinate specified in the constructor.
    `double` | `getZ()` Returns the z-coordinate specified in the constructor.
    `int` | `hashCode()`
    `java.lang.String` | `toString()` Returns a string representation of this instance, primarily for debugging purposes.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ORIGIN

          public static final Point3D ORIGIN

      The origin `(0, 0, 0)`.

    - #### UNIT_X

          public static final Point3D UNIT_X

      The point `(1, 0, 0)`.

    - #### UNIT_Y

          public static final Point3D UNIT_Y

      The point `(0, 1, 0)`.

    - #### UNIT_Z

          public static final Point3D UNIT_Z

      The point `(0, 0, 1)`.

    - #### x

          public double x

      The x-coordinate.

    - #### y

          public double y

      The y-coordinate.

    - #### z

          public double z

      The z-coordinate.

  - ### Constructor Detail

    - #### Point3D

          public Point3D(double x,
                         double y,
                         double z)

      Creates a new point in 3D space.
      Parameters:
        `x` - the x-coordinate.
        `y` - the y-coordinate.
        `z` - the z-coordinate.

  - ### Method Detail

    - #### createPoint3D

          public static Point3D createPoint3D(double theta,
                                              double phi,
                                              double rho)

      Creates a new `Point3D` instance from spherical coordinates.
      Parameters:
        `theta` - theta (in radians).
        `phi` - phi (in radians).
        `rho` - the distance from the origin.
      Returns:
        The point (never `null`).

    - #### getX

          public double getX()

      Returns the x-coordinate specified in the constructor.
      Returns:
        The x-coordinate.

    - #### getY

          public double getY()

      Returns the y-coordinate specified in the constructor.
      Returns:
        The y-coordinate.

    - #### getZ

          public double getZ()

      Returns the z-coordinate specified in the constructor.
      Returns:
        The z-coordinate.

    - #### getTheta

          public double getTheta()

      Returns theta (calculated from the cartesian coordinates).
      Returns:
        Theta.

    - #### getPhi

          public double getPhi()

      Returns phi (calculated from the cartesian coordinates).
      Returns:
        phi.

    - #### getRho

          public double getRho()

      Returns rho (calculated from the cartesian coordinates).
      Returns:
        rho.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this instance for equality to an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this instance, primarily for debugging purposes.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A string (never `null`).