Class Point

java.lang.Object
davidmarino.model.mapmodels.Point

public class Point extends Object
The Point class represents a point in euclidean space.
  • Field Details

    • x

      public double x
    • y

      public double y
    • z

      public double z
  • Constructor Details

    • Point

      public Point(double x, double y)
      Point constructor not including z
      Parameters:
      x -
      y -
    • Point

      public Point(double x, double y, double z)
      Point copy constructor
      Parameters:
      x -
      y -
      z -
  • Method Details

    • withinBounds

      public static boolean withinBounds(ArrayList<Point> points, int x, int y, int space)
      Checks if a point is within a certain distance of another point.
      Parameters:
      points - is a list of all points
      x -
      y -
      space - is the set distance between points
      Returns:
      boolean
    • generateRandomPoints

      public static ArrayList<Point> generateRandomPoints(int count)
      Creates random points dispersed within the domain and range of the image.
      Parameters:
      count - of the points created
      Returns:
      ArrayList<Point>
    • interpolate

      public static Point interpolate(Point a, Point b, double t)
      Calculates a point between a and b based on value t.
      Parameters:
      a - point
      b - point
      t - value ranging 0 to 1
      Returns:
      Point
    • drawPoints

      public static void drawPoints(Graphics2D g2, ArrayList<Point> points, Color color)
      Renders a set of points.
      Parameters:
      g2 - is the render library
      points - to be rendered
      color - of the points
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object