Table of Contents

Method Transform

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Transform(GeoPoint3)

Transforms a point.

public GeoPoint3 Transform(GeoPoint3 point)

Parameters

point GeoPoint3

Returns

GeoPoint3

Transform(GeoVector3)

Transforms a vector, ignoring the translation part.

public GeoVector3 Transform(GeoVector3 vector)

Parameters

vector GeoVector3

Returns

GeoVector3

Remarks

A vector has a direction and a length but no position, so moving the whole of space must leave it unchanged. That is why the translation column takes no part here and why transforming a point and transforming the vector between two points give different answers.

Transform(GeoLine3)

Transforms a line segment by transforming both of its endpoints.

public GeoLine3 Transform(GeoLine3 line)

Parameters

line GeoLine3

Returns

GeoLine3

Transform(GeoRay3)

Transforms a ray.

public GeoRay3 Transform(GeoRay3 ray)

Parameters

ray GeoRay3

Returns

GeoRay3

Exceptions

InvalidOperationException

Thrown when the transformation flattens the ray direction to nothing.

Transform(GeoTriangle3)

Transforms a triangle by transforming its three vertices.

public GeoTriangle3 Transform(GeoTriangle3 triangle)

Parameters

triangle GeoTriangle3

Returns

GeoTriangle3

Transform(GeoPlane3)

Transforms a plane.

public GeoPlane3 Transform(GeoPlane3 plane)

Parameters

plane GeoPlane3

Returns

GeoPlane3

Remarks

A plane normal is not transformed like a direction. Under a non-uniform scaling a direction in the plane and the normal are stretched differently, and applying the same matrix to both would leave them no longer perpendicular. The normal follows the inverse transpose instead, which is the matrix that preserves that right angle.

Exceptions

InvalidOperationException

Thrown when the transformation is not invertible.

Transform(GeoCoordinateSystem3)

Transforms a local coordinate system.

public GeoCoordinateSystem3 Transform(GeoCoordinateSystem3 system)

Parameters

system GeoCoordinateSystem3

Returns

GeoCoordinateSystem3

Exceptions

ArgumentException

Thrown when the transformation flattens the frame so that its axes no longer span space.

Transform(GeoObb3)

Transforms an oriented box.

public GeoObb3 Transform(GeoObb3 box)

Parameters

box GeoObb3

Returns

GeoObb3

Remarks

A box stays a box only under a transformation that keeps right angles right. A shear turns it into a parallelepiped, which this type cannot represent, and what comes back then is the box spanned by the transformed axes rather than the true sheared shape.

Exceptions

ArgumentException

Thrown when the transformation collapses the box orientation.

Transform(GeoAabb3)

Transforms an axis-aligned box.

public GeoAabb3 Transform(GeoAabb3 box)

Parameters

box GeoAabb3

Returns

GeoAabb3

Remarks

A box aligned with the world axes does not stay aligned once it is rotated, so what comes back is the smallest aligned box holding the transformed corners. That is larger than the true transformed shape whenever the transformation turns it, which is the price of insisting on alignment; transform a GeoObb3 instead to keep the shape exactly.

Transform(GeoCircle3)

Transforms a circle.

public GeoCircle3 Transform(GeoCircle3 circle)

Parameters

circle GeoCircle3

Returns

GeoCircle3

Remarks

A circle survives a transformation only when every direction in its plane is stretched by the same amount. Under a non-uniform scaling it becomes an ellipse, which this library has no type for, so the attempt is refused rather than answered with a circle of some averaged radius.

Exceptions

InvalidOperationException

Thrown when the transformation would turn the circle into an ellipse.

Transform(IEnumerable<GeoPoint3>)

Transforms a sequence of points.

public IEnumerable<GeoPoint3> Transform(IEnumerable<GeoPoint3> points)

Parameters

points IEnumerable<GeoPoint3>

Returns

IEnumerable<GeoPoint3>