Package snap.gfx3d

Class Point3D

java.lang.Object
snap.gfx3d.Point3D
All Implemented Interfaces:
Cloneable

public class Point3D extends Object implements Cloneable
This class represents a 3D point.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    double
     
    double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
    Point3D(double x, double y, double z)
    Constructor for the x, y, z components.
  • Method Summary

    Modifier and Type
    Method
    Description
    Standard clone implementation.
    boolean
    equals(Object anObj)
    Standard equals implementation.
    double
    getDistance(double aX, double aY, double aZ)
    Returns the distance to another point.
    static final double
    getDistance(double x1, double y1, double z1, double x2, double y2, double z2)
    Returns the distance from this Point to a specified point.
    double
    Returns the distance to another point.
    static final double
    getDistanceSquared(double x1, double y1, double z1, double x2, double y2, double z2)
    Returns the distance from this Point to a specified point.
    void
    setPoint(double x, double y, double z)
    Sets the point from components.
    void
    setPoint(Point3D aPoint)
    Sets the point from components.
    Standard toString implementation.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public double x
    • y

      public double y
    • z

      public double z
  • Constructor Details

    • Point3D

      public Point3D()
      Constructor.
    • Point3D

      public Point3D(double x, double y, double z)
      Constructor for the x, y, z components.
  • Method Details

    • setPoint

      public void setPoint(double x, double y, double z)
      Sets the point from components.
    • setPoint

      public void setPoint(Point3D aPoint)
      Sets the point from components.
    • getDistance

      public double getDistance(Point3D aPoint)
      Returns the distance to another point.
    • getDistance

      public double getDistance(double aX, double aY, double aZ)
      Returns the distance to another point.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • clone

      public Point3D clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • getDistance

      public static final double getDistance(double x1, double y1, double z1, double x2, double y2, double z2)
      Returns the distance from this Point to a specified point.
    • getDistanceSquared

      public static final double getDistanceSquared(double x1, double y1, double z1, double x2, double y2, double z2)
      Returns the distance from this Point to a specified point.