Obtain the coordinates of ellipse semi axes end points

conic sectionsgeometry

I have a set of polygons and I would like to obtain a minimum volume enclosing ellipse individually for each polygon. The axes of the resultant ellipse can be parallel to both x- and y-axis, one of them or neither.

I have succeeded to obtain the length of the semi-axes a and b, the centre c coordination (h,k), the alpha angle between the positive x-axis and the major axis of the ellipse. This was done with the R function here

Since the axes of the resultant ellipse can be configured in diffrent ways regarding the x- and y-axis, I can't just add the length of semi axes to the centre coordinates. See the image:
enter image description here

the ellipse in the image has the following features:

#c(h,k)
> c                
[1] 34.55566 14.20828

# semi.axes a and b 
> semi.axes
[1] 1.385251 1.093675

# alpha in radians
> alpha
[1] 0.8780137

#Transformation of the ellipse parameters into the matrix representation
> ellipseToConicMatrix(semi.axes,c,alpha)
            [,1]       [,2]       [,3]
[1,]   0.7075787 -0.1547601 -22.251973
[2,]  -0.1547601  0.6495811  -3.881593
[3,] -22.2519725 -3.8815932 823.082326

Question: how it can I obtain the coordinates of the points EX1, EX2, EY1, and EY2?

Best Answer

Hopefully I understand the setting and the R-module correctly.

The end points are rotated by given angle $\alpha$ centered around point $C$ at the given $(h,k)$. Namely,

$$\begin{align} \text{EX1 coordinates} &= (h\, ,~k) + (a\cos\alpha\, ,~ a\sin\alpha) \\ \text{EX2 coordinates} &= (h\, ,~k) - (a\cos\alpha\, ,~ a\sin\alpha) \\ \text{EY1 coordinates} &= (h\, ,~k) + (-b\sin\alpha\, ,~ b\cos\alpha) \\ \text{EY2 coordinates} &= (h\, ,~k) - (-b\sin\alpha\, ,~ b\cos\alpha) \end{align}$$ This should work for any $\alpha$ (in radians), assuming the semi-major $a$ is defined to be along $x$-axis for the "default" (or "unrotated") ellipse. That is, even if $a<b$ we still call $a$ the semi-major.