|
ProjGeom 1.0.11
|
A conic section represented by a symmetric 3x3 matrix. More...
#include <conic.hpp>
Public Types | |
| using | Mat3x3 = std::array< std::array< Fraction, 3 >, 3 > |
Public Member Functions | |
| constexpr | Conic (Mat3x3 matrix) |
| Construct a new Conic from a symmetric matrix. | |
| constexpr auto | contains (const PgPoint &point) const -> bool |
| Check whether a point lies on the conic. | |
| constexpr auto | polar (const PgPoint &point) const -> PgLine |
| Polar line of a point with respect to the conic. | |
| constexpr auto | tangent (const PgPoint &point) const -> PgLine |
| Tangent line at a point on the conic. | |
| constexpr auto | pole (const PgLine &line) const -> PgPoint |
| Pole of a line with respect to the conic (placeholder). | |
| auto | intersect (const PgLine &line) const -> std::vector< PgPoint > |
| Intersection of a line with the conic (placeholder). | |
| constexpr auto | discriminant () const -> Fraction |
| Discriminant of the conic (det of the 2x2 upper-left block). | |
| constexpr auto | conic_type () const -> ConicType |
| Determine the conic type from the discriminant. | |
| constexpr auto | matrix () const -> const Mat3x3 & |
| Access the matrix. | |
| constexpr auto | operator== (const Conic &other) const -> bool |
Static Public Member Functions | |
| static constexpr auto | circle (std::int64_t center_x, std::int64_t center_y, std::int64_t radius_sq) -> Conic |
| Create a circle with centre (cx, cy) and squared radius r². | |
| static constexpr auto | unit_circle () -> Conic |
| Create a unit circle centred at the origin. | |
| static constexpr auto | parabola (const Fraction &a) -> Conic |
| Create a parabola \(y = a x^2\). | |
A conic section represented by a symmetric 3x3 matrix.
A point \(\mathbf{x}=(x:y:z)\) lies on the conic iff \(\mathbf{x}^T Q \mathbf{x}=0\).
| using fun::Conic::Mat3x3 = std::array<std::array<Fraction, 3>, 3> |
|
inlineexplicitconstexpr |
Construct a new Conic from a symmetric matrix.
| [in] | matrix | The 3x3 symmetric matrix Q. |
|
inlinestaticconstexpr |
Create a circle with centre (cx, cy) and squared radius r².
\[ (x-c_x)^2 + (y-c_y)^2 = r^2 \]
| [in] | center_x | X coordinate of centre. |
| [in] | center_y | Y coordinate of centre. |
| [in] | radius_sq | Squared radius. |
|
inlineconstexpr |
Determine the conic type from the discriminant.
|
inlineconstexpr |
Check whether a point lies on the conic.
\[ \mathbf{x}^T Q \mathbf{x} = 0 \]
| [in] | pt | The point to test. |
|
inlineconstexpr |
Discriminant of the conic (det of the 2x2 upper-left block).
\[ \Delta = a e - b d \]
>0 → ellipse, =0 → parabola, <0 → hyperbola.
Intersection of a line with the conic (placeholder).
Currently returns an empty vector.
| [in] | line | The line. |
|
inlineconstexpr |
Access the matrix.
|
inlineconstexpr |
Polar line of a point with respect to the conic.
\[ \mathbf{l} = Q \mathbf{x} \]
| [in] | point | The point. |
Pole of a line with respect to the conic (placeholder).
\[ \mathbf{x} = Q^{-1} \mathbf{l} \]
Currently returns a point with the same coordinates as the line.
| [in] | line | The line. |
Tangent line at a point on the conic.
At a point \(\mathbf{p}\) on the conic, the tangent is the polar:
\[ \mathbf{t} = Q \mathbf{p} \]
| [in] | point | A point on the conic. |
|
inlinestaticconstexpr |