The MathUtils type exposes the following members.
Methods
Name | Description | |
---|---|---|
AngleBetween |
Get the angle between two Vector3D in the range [0:360]
| |
AreCoplanar |
Determines whether two triangles are coplanar (true if normals are inverse too)
| |
CalculateMedian(array<Vector3D>[]()[][]) |
Try to calculate the normalized resulting median Vector3D for the angles between
each pair of the specified vectors.
In the simple case that just two Vector3D are given, a real median is calculated on
the plane defined by these two, else an attempt is made to calculate a normalized sum of all
the Vector3D. In the latter case, parallel Vector3D having opposite
directions may change the expected direction for the resulting median.
| |
CalculateMedian(Vector3D, Vector3D) |
Calculate the normalized median Vector3D for the smallest angle between
two Vector3D. In the particular case the two vectors are parallel having opposite directions,
the median will have the direction of the first vector rotated by counterclockwise 90 degrees.
| |
CalculateNormal |
Calculates the normal to 3 points.
| |
Canvas2DToViewport3D |
FOR INTERNAL USE ONLY. Convert a 2D point into a 3D point
| |
ClipLineSegment |
Clips a line segment by an axis oriented bounding box
(using the Cohen-Sutherland algorithm).
| |
ClipPolygon(List<(Of <<'(Point3D>)>>), Rect3D) |
Clips polygon (must be planar and convex) by given axis-aligned bounding box
using the Sutherland-Hodgman algorithm.
| |
ClipPolygon(List<(Of <<'(Point3D>)>>), Point3D, Vector3D) |
Clips polygon (must be planar and convex) by given plane using the Sutherland-Hodgman algorithm.
| |
Compose |
Composes transformation matrix from given translation, scale and rotation values.
| |
Decompose |
Decomposes matrix of a skew-free 3D transformation into separate
translation, scaling and rotation values.
| |
DegreesToRadians |
Convert an angle from degrees to radiants
| |
FergussonCubic |
Calculates interpolated point using the Fergusson's cubic.
| |
GetAspectRatio |
Gets the aspect ration of a Size
| |
GetCenter |
Computes the center of 'box'
| |
GetDistanceFromLine |
Gets a Vector3D giving the distance (and the direction) of the line passing through the given point
and normal to the line defined by linePoint and lineDirection.
| |
GetLineAABBIntersection |
Gets the intersection (if existing) of a line defined by a point and a vector with the specified AABB box.
| |
GetLinePlaneIntersection |
Calculates the intersection (if existing) between a line and a plane.
| |
GetLinesIntersection |
Calculates the intersection (if existing) between two 3D line primitives, being each one defined by two Point3Ds.
| |
GetPlaneAABBIntersection |
Gets whether an intersection exists between a plane and an AABB box.
| |
GetProjectionMatrix |
Computes the effective projection matrix for the given
camera.
| |
GetRotationMatrixBetween |
Get the rotation Matrix3D that describes the rotation between two Vector3D | |
GetRotationMatrixFromFullTransformMatrix |
Get the rotation Matrix3D that describes the rotation portion of a full transformation Matrix3D | |
GetRotationMatrixFromObject |
Get the rotation Matrix3D that describes the orientation of an object
| |
GetTransformToAncestor |
Computes the transform from the inner space of the given
Visual3D to the 3D space of the Viewport3DVisual which
contains it.
The result will contain the transform of the given visual.
| |
GetTriangleCircumcenter |
Calculates the center Point3D of the circumference the (v0, v1, v2) triangle is inscribed.
| |
GetVectorRotationMatrix |
Calculates the Matrix3D needed to rotate a Vector3D from its startOrientation
and having it aligned to the alignTo direction.
| |
GetViewMatrix |
Computes the effective view matrix for the given
camera.
| |
IsValid |
Checks validity of given vector. Valid vectors have all components
well defined (i.e., no NaN or Infinity values are allowed).
| |
Orient3D |
Determines the orientation of the point q in regards to the plane given by points a, b, c.
| |
PointPlaneDistance |
Gets a "signed" distance between point and plane in 3D.
| |
PointPlaneProjection |
Returns projection of a point on plane in 3D.
| |
RadiansToDegrees |
Convert an angle from radiants to degrees
| |
Rect3DContains |
Gets a value indicating whether the specified testPoint is contained within the boundaries of a 3D
rectangle defined by two other Point3Ds.
| |
RotationAnglesFromVector |
Calculate a Vector3D containing the rotation angles (in degrees) around
the 3D axis for the given Vector3D.
| |
RoundValues |
Rounds each component of a vector for given number of decimals.
| |
SplineInterpolation |
Creates array of interpolated points using the natural cubic spline.
| |
TriangleArea |
Calculates area of triangle defined by the given points.
| |
TryNormalize |
Normalizes v if |v| > 0.
This normalization is slightly different from Vector3D.Normalize. Here
we just divide by the length but Vector3D.Normalize tries to avoid
overflow when finding the length.
| |
TryTransformTo2DAncestor |
Computes the transform from the inner space of the given
Visual3D to the 2D space of the Viewport3DVisual which
contains it.
The result will contain the transform of the given visual.
This method can fail if Camera.Transform is non-invertable
in which case the camera clip planes will be coincident and
nothing will render. In this case success will be false.
| |
TryWorldToViewportTransform |
Computes the transform from world space to the Viewport3DVisual's
inner 2D space.
This method can fail if Camera.Transform is non-invertable
in which case the camera clip planes will be coincident and
nothing will render. In this case success will be false.
| |
Vieport3DToCanvas2D |
Map a point from the 3D viewport space into the 2D canvas space
|