Class Point3D

java.lang.Object
inra.ijpb.geometry.Point3D

public class Point3D
extends java.lang.Object
A point in the 3-dimensional Euclidean space, defined by x, y, and z coordinates.
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    Point3D()
    Creates a new point located at the origin.
    Point3D​(double x, double y, double z)
    Creates a new point at the specified coordinates.
  • Method Summary

    Modifier and Type Method Description
    double distance​(Point3D point)
    Computes the euclidean distance to another point.
    double getX()  
    double getY()  
    double getZ()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Point3D

      public Point3D()
      Creates a new point located at the origin.
    • Point3D

      public Point3D​(double x, double y, double z)
      Creates a new point at the specified coordinates.
      Parameters:
      x - the X-coordinate of the point
      y - the Y-coordinate of the point
      z - the Z-coordinate of the point
  • Method Details

    • distance

      public double distance​(Point3D point)
      Computes the euclidean distance to another point.
      Parameters:
      point - the other point
      Returns:
      the distance between this point and the query point
    • getX

      public double getX()
      Returns:
      the X-coordinate of the point
    • getY

      public double getY()
      Returns:
      the Y-coordinate of the point
    • getZ

      public double getZ()
      Returns:
      the Z-coordinate of the point