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 sealed class BasePoint<T extends Number> extends Object permits CartesianPoint, ScreenPoint
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
    • id

      private UUID id
  • 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

    • getId

      public UUID getId()
    • setId

      public void setId(UUID id)
    • areCollinear

      @Contract(pure=true) public static boolean areCollinear(@NotNull CartesianPoint p1, @NotNull CartesianPoint p2, @NotNull 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.