Answer the question
In order to leave comments, you need to log in
How to get the canonical equation of an ellipse given its N points?
As a result of a series of operations with a circle with known coordinates, namely: the rotation of its "axis" at angles a, b around the axes Z, Y, respectively, and its subsequent projection onto the OXZ plane at angles c, d, an ellipse was obtained.
Known: the coordinates of the center of the ellipse,
its offset relative to the zero point of the coordinate system, the coordinates
of the required number of points to derive the equation of the ellipse (they are put on the circle before the start of all transformations).
Unknown:
the length of the semiaxes;
angle of rotation of the semiaxes;
It is necessary:
to be able to check whether an arbitrary point belongs to an ellipse, which requires the derivation of an equation;
calculate the area of the ellipse.
The calculation algorithm is implemented in JAVA, the calculation is correct using the Kompas drawing software.
I studied the Internet for possible solutions, however, either I understand too poorly or there is almost nothing on the case.
I see two options: to check whether a point belongs to an ellipse, perform inverse transformations of the checked point and check whether it belongs to a circle, but this will not allow you to calculate the area of the ellipse.
Second option: representing the ellipse as a curve of the second order and solving a matrix with 5 unknowns, but not very good in programming, as well as in mathematics, to specify the algorithm. I took the JAMA library, but since it is impossible to set conditions for the desired values when solving the matrix, it simply makes all the terms of the equation of the second-order curve zero, which is the solution of the matrix.
I ask you to suggest the shortest way to solve the problem or, if there is one, share the code.
On the projected ellipse, the blue intersecting lines are its axes, built using the Compass functionality. In general, the task comes down to understanding how he determines the semiaxes, knowing the center of the ellipse and any 3 points belonging to it
Answer the question
In order to leave comments, you need to log in
1. To check if the point is inside the ellipse - your suggestion is the most reasonable. Fortunately, all transformations are affine and their inverses are easy to construct. Find the prototype of the point of interest in the plane of the circle and easily check the hit.
2. With affine transformations, the perpendicular diameters of the circle will go into the conjugate diameters of the ellipse. Knowing the conjugate diameter vectors c1, c2
, it is easy to calculate the area of the ellipse π Abs(VectorProduct(c1,c2))
.
If some other parameters of the ellipse are needed, then they can be calculated from the properties of conjugate diameters (in English literature, conjugate diameters).
Major diameters are often built using Rytz's consturction .
Parametric equation of an ellipse:
x = a * cos(t)
y = b * sin(t)
0 ≤ t ≤ 2π
где a, b − полуоси эллипса, t − параметр.
t
: (sin^2 + cos^2) = 1
a
it as a function b
for known (x, y). a = f(b)
1. There are two planes in a single coordinate system (the plane of the circle and the plane where we will project it).
2. We calculate the projection of any arbitrary point belonging to one plane onto another plane (3D): here .
3. Whether the point belongs to a circle or an ellipse - we check in the same way (item 2), using the desired plane to project the point onto another plane.
(For a circle/circle: only a special case - if we are not talking about using perspective/scattering! For example, it will not work if you need to project a spotlight beam using perspective )
PS: Converting a second-order curve to a canonical form (2D): here .
It is necessary to substitute the coordinates of 5 points (already projected onto the plane) into each 2nd order equation and solve a system of 6 equations (5 and 1 canonical form for the ellipse) and 2 inequalities (for the ellipse coefficients) to find all coefficients of the 2nd order equation for the ellipse and, if necessary, bring it to the canonical form.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question