Class Parabola
java.lang.Object
org.episteme.core.mathematics.geometry.curves.Parabola
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsPoint(Point2D p, double tolerance) Checks if a point is on the parabola (within tolerance).doublederivative(double x) Returns the derivative dy/dx at point x.doubleevaluate(double x) Evaluates y for a given x (non-rotated parabola).static ParabolafromFocusAndDirectrix(double focusX, double focusY, double directrixY) Creates a parabola from focus and directrix.doubledoubleReturns the directrix y-coordinate (for non-rotated parabola).doubleReturns the focal length p = 1/(4|a|).getFocus()Returns the focus of the parabola.doubleReturns the vertex as a Point2D.doubledoublepointAt(double t) Returns a point on the parabola at parameter t.toString()
-
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
Returns the vertex as a 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
Returns a point on the parabola at parameter t. -
derivative
public double derivative(double x) Returns the derivative dy/dx at point x. -
containsPoint
Checks if a point is on the parabola (within tolerance). -
fromFocusAndDirectrix
Creates a parabola from focus and directrix. -
toString
-