Parabola¶
A parabola is a specific instance of a conic section.
- class conics.Parabola(vertex, p, alpha)[source]¶
Represents a parabola given in the standard form by \(y^2=2px\) (i.e., opening to the right) in general position obtained by rotating the canonic parbola by angle \(-\pi\leq\alpha<\pi\) and shifting the vertex by \(\vec x_c\in\mathbb{R}^2\).
- Parameters:
vertex (numpy.ndarray) – The 2-D coordinate of the parabola vertex.
p (float) – The distance of the vertex to the focus.
alpha (float) – The orientation of the parabola in the \(xy\) plane.
- contact(pts, **kwargs)[source]¶
Computes the contact points on the parabola from the coordinates pts.
- Parameters:
pts (numpy.ndarray) – \(N\times2\) matrix of 2-D coordinates whose contact points are to be determined.
**kwargs – Additional arguments passed to
scipy.optimize.least_squares().
- Returns:
\(N\times2\) matrix of 2-D coordinates representing the contact points.
- Return type:
- static from_conic(C)[source]¶
Constructs a parabola from its general algebraic form.
- Returns:
The geometric representation of the parabola.
- Return type:
- refine(pts, **kwargs)[source]¶
Refines the parabola parameters with respect to some reference 2-D coordinates.
The refinement is performed by minimizing the distances between the orthogonal contact points on the parabola and the observed points pts.
The method implements the approach from [ARW01].
- Parameters:
pts (numpy.ndarray) – Observed 2-D coordinates of the parabola.
**kwargs – Additional arguments passed to
scipy.optimize.least_squares().
- Returns:
The refined parabola.
- Return type: