Class Parabola

java.lang.Object
org.episteme.core.mathematics.geometry.curves.Parabola

public class Parabola extends Object
Represents a parabola in 2D space.

A parabola is defined by the equation: y = a(x-h)² + k where (h,k) is the vertex and a determines the shape.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • Parabola

      public Parabola(double vertexX, double vertexY, double a)
      Creates a parabola with vertex at (h, k) and coefficient a.
    • Parabola

      public Parabola(double vertexX, double vertexY, double a, double rotation)
      Creates a rotated parabola.
  • Method Details

    • getVertexX

      public double getVertexX()
    • getVertexY

      public double getVertexY()
    • getCoefficient

      public double getCoefficient()
    • getRotation

      public double getRotation()
    • getVertex

      public Point2D getVertex()
      Returns the vertex as a Point2D.
    • getFocus

      public Point2D getFocus()
      Returns the focus of the parabola.
    • getFocalLength

      public double getFocalLength()
      Returns the focal length p = 1/(4|a|).
    • getDirectrixY

      public double getDirectrixY()
      Returns the directrix y-coordinate (for non-rotated parabola).
    • evaluate

      public double evaluate(double x)
      Evaluates y for a given x (non-rotated parabola).
    • pointAt

      public Point2D pointAt(double t)
      Returns a point on the parabola at parameter t.
    • derivative

      public double derivative(double x)
      Returns the derivative dy/dx at point x.
    • containsPoint

      public boolean containsPoint(Point2D p, double tolerance)
      Checks if a point is on the parabola (within tolerance).
    • fromFocusAndDirectrix

      public static Parabola fromFocusAndDirectrix(double focusX, double focusY, double directrixY)
      Creates a parabola from focus and directrix.
    • toString

      public String toString()
      Overrides:
      toString in class Object