Class Point2D

java.lang.Object
org.jgrapht.alg.drawing.model.Point2D
All Implemented Interfaces:
Serializable

public class Point2D extends Object implements Serializable
A 2-dimensional point in Euclidean space.
Author:
Dimitrios Michail
See Also:
  • Field Summary

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

    Constructors
    Constructor
    Description
    Point2D(double x, double y)
    Create a new point
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Get the number of dimensions of the point
    double
    Get the x coordinate
    double
    Get the y coordinate
    int
     
    static Point2D
    of(double x, double y)
    Create a new point
     

    Methods inherited from class java.lang.Object

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

    • x

      protected double x
    • y

      protected double y
  • Constructor Details

    • Point2D

      public Point2D(double x, double y)
      Create a new point
      Parameters:
      x - the x coordinate
      y - the y coordinate
  • Method Details

    • getNumDimensions

      public int getNumDimensions()
      Get the number of dimensions of the point
      Returns:
      the number of dimensions of the point
    • getX

      public double getX()
      Get the x coordinate
      Returns:
      the x coordinate
    • getY

      public double getY()
      Get the y coordinate
      Returns:
      the y coordinate
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • of

      public static Point2D of(double x, double y)
      Create a new point
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the point
    • toString

      public String toString()
      Overrides:
      toString in class Object