I have difficulties determining the equation of a transformed elliptical arc which my company needs for their laser marking software. I'm starting out with an elliptical arc that is in either centerpoint or endpoint parameterization (http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter). Now, this arc can be rotated, scaled (where the scaling in x-direction can be different from the scaling in the y-direction), translated and can also be mirrored. These transformations can happen in any order, I just get to see a matrix. Now I guess after these transformations, I would still have an elliptical arc, but how to determine the new endpoint parameterization equation of that ellipse?
I already tried the following: I store the absolute coordinates of the two focal points of the ellipse, of the start point of the elliptical arc and the end point of the elliptical arc. Then I can of course multiply all these points by a matrix and at least these stay correct. Then the angle to the x-axis of the new ellipse equation should be $ \sphericalangle (\vec{F1F2}, (1,0)) $ (the formula to calculate an angle between two vectors is also here http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter Equation F.6.5.4) but where it's not totally clear to me which sign this angle should have. I can also calculate easily $rx$ and $ry$ by the help of the two focal points and one point (e.g. the starting point) lying on the outline of the ellipse. But my problem is how can I calculate the sweep flag and the large arc flag (these belong to the endpoint parameterization of the elliptical arc). E.g. after mirroring I need to sweep along the elliptical arc along decreasing angle where before the mirroring I went along increasing angles. What would be the easiest way to determine this? I could in principle store any amount of information of the original elliptical arc as long as I finally get the elliptical arc in endpoint parametrization.
Any help is very much appreciated.
Sounds like you need to determine if the net transformation preserves orientation. That’s easy: if the determinant of the matrix is positive, it is orientation-preserving; if it’s negative, you’ll need to reverse the sweep.