Method TransformBy
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
TransformBy(GeoEllipse2, GeoTransform2)
Applies a transformation to an ellipse. Every transformation that does not flatten the plane gives an ellipse: a move, a turn, a mirror, a scaling even or uneven, and a shear.
public static GeoEllipse2 TransformBy(GeoEllipse2 ellipse, GeoTransform2 transform)
Parameters
ellipseGeoEllipse2The ellipse.
transformGeoTransform2The transformation.
Returns
- GeoEllipse2
The transformed ellipse.
Remarks
The radii and the major axis come from the singular values of the transformation applied to the two semi-axes: a circle of radius 100 scaled by 3 along X and 1 along Y is the ellipse 300 by 100 along X. The zero of the eccentric angle goes to the end of the new major axis nearer where the old one went, so it is generally not the image of the old zero. When the two new radii agree to 1E-12 the result is a circle, and its major axis is where the old one went, so a turn carries the zero of the angle round with it.
A transformation that turns the plane over, a mirror or a negative scaling, reverses the way the eccentric angle runs round the rim as seen in the old frame: the new ellipse still runs counter-clockwise, so the points the old one reached at increasing angles are reached by the new one at decreasing angles.
Exceptions
- ArgumentNullException
Thrown when the transformation is null.
- InvalidOperationException
Thrown when the transformation flattens the plane onto a line or a point: when the area it scales by is no more than 1E-12 of the square of its size.