Class BasePoint<T extends Number>

java.lang.Object
com.j3d.engine.math.BasePoint<T>
Type Parameters:
T - The type of the given point, which can either be an Integer or Double or any other thing that extends Number
Direct Known Subclasses:
CartesianPoint, ScreenPoint

public abstract class BasePoint<T extends Number> extends Object
Base Point is a generic 2D point base class
Author:
Lehlogonolo Poole
See Also:
  • Field Details

    • x

      public final T extends Number x
      Tge X-Value
    • y

      public final T extends Number y
      The Y-Value
  • Constructor Details

    • BasePoint

      public BasePoint(T xcord, T ycord)
      Default Constructor Initializing the point.
      Parameters:
      xcord - The x-coordinate.
      ycord - The y-coordinate
  • Method Details

    • areCollinear

      public static boolean areCollinear(CartesianPoint p1, CartesianPoint p2, CartesianPoint p3)
      A static class that checks if 3 CartesianPoints lie on the same line (Are collinear)
      Parameters:
      p1 - Point 1
      p2 - Point 2
      p3 - Poit 3
      Returns:
      A boolean value indicating whether the points are collinear or not.