The MathUtils type exposes the following members.

Methods

  NameDescription
Public methodStatic memberAngleBetween
Get the angle between two Vector3D in the range [0:360]
Public methodStatic memberAreCoplanar
Determines whether two triangles are coplanar (true if normals are inverse too)
Public methodStatic memberCalculateMedian(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.
Public methodStatic memberCalculateMedian(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.
Public methodStatic memberCalculateNormal
Calculates the normal to 3 points.
Public methodStatic memberCanvas2DToViewport3D
FOR INTERNAL USE ONLY. Convert a 2D point into a 3D point
Public methodStatic memberClipLineSegment
Clips a line segment by an axis oriented bounding box (using the Cohen-Sutherland algorithm).
Public methodStatic memberClipPolygon(List<(Of <<'(Point3D>)>>), Rect3D)
Clips polygon (must be planar and convex) by given axis-aligned bounding box using the Sutherland-Hodgman algorithm.
Public methodStatic memberClipPolygon(List<(Of <<'(Point3D>)>>), Point3D, Vector3D)
Clips polygon (must be planar and convex) by given plane using the Sutherland-Hodgman algorithm.
Public methodStatic memberCompose
Composes transformation matrix from given translation, scale and rotation values.
Public methodStatic memberDecompose
Decomposes matrix of a skew-free 3D transformation into separate translation, scaling and rotation values.
Public methodStatic memberDegreesToRadians
Convert an angle from degrees to radiants
Public methodStatic memberFergussonCubic
Calculates interpolated point using the Fergusson's cubic.
Public methodStatic memberGetAspectRatio
Gets the aspect ration of a Size
Public methodStatic memberGetCenter
Computes the center of 'box'
Public methodStatic memberGetDistanceFromLine
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.
Public methodStatic memberGetLineAABBIntersection
Gets the intersection (if existing) of a line defined by a point and a vector with the specified AABB box.
Public methodStatic memberGetLinePlaneIntersection
Calculates the intersection (if existing) between a line and a plane.
Public methodStatic memberGetLinesIntersection
Calculates the intersection (if existing) between two 3D line primitives, being each one defined by two Point3Ds.
Public methodStatic memberGetPlaneAABBIntersection
Gets whether an intersection exists between a plane and an AABB box.
Public methodStatic memberGetProjectionMatrix
Computes the effective projection matrix for the given camera.
Public methodStatic memberGetRotationMatrixBetween
Get the rotation Matrix3D that describes the rotation between two Vector3D
Public methodStatic memberGetRotationMatrixFromFullTransformMatrix
Get the rotation Matrix3D that describes the rotation portion of a full transformation Matrix3D
Public methodStatic memberGetRotationMatrixFromObject
Get the rotation Matrix3D that describes the orientation of an object
Public methodStatic memberGetTransformToAncestor
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.
Public methodStatic memberGetTriangleCircumcenter
Calculates the center Point3D of the circumference the (v0, v1, v2) triangle is inscribed.
Public methodStatic memberGetVectorRotationMatrix
Calculates the Matrix3D needed to rotate a Vector3D from its startOrientation and having it aligned to the alignTo direction.
Public methodStatic memberGetViewMatrix
Computes the effective view matrix for the given camera.
Public methodStatic memberIsValid
Checks validity of given vector. Valid vectors have all components well defined (i.e., no NaN or Infinity values are allowed).
Public methodStatic memberOrient3D
Determines the orientation of the point q in regards to the plane given by points a, b, c.
Public methodStatic memberPointPlaneDistance
Gets a "signed" distance between point and plane in 3D.
Public methodStatic memberPointPlaneProjection
Returns projection of a point on plane in 3D.
Public methodStatic memberRadiansToDegrees
Convert an angle from radiants to degrees
Public methodStatic memberRect3DContains
Gets a value indicating whether the specified testPoint is contained within the boundaries of a 3D rectangle defined by two other Point3Ds.
Public methodStatic memberRotationAnglesFromVector
Calculate a Vector3D containing the rotation angles (in degrees) around the 3D axis for the given Vector3D.
Public methodStatic memberRoundValues
Rounds each component of a vector for given number of decimals.
Public methodStatic memberSplineInterpolation
Creates array of interpolated points using the natural cubic spline.
Public methodStatic memberTriangleArea
Calculates area of triangle defined by the given points.
Public methodStatic memberTryNormalize
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.
Public methodStatic memberTryTransformTo2DAncestor
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.
Public methodStatic memberTryWorldToViewportTransform
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.
Public methodStatic memberVieport3DToCanvas2D
Map a point from the 3D viewport space into the 2D canvas space

Fields

  NameDescription
Public fieldStatic memberNegXAxis
Represents the negative X direction
Public fieldStatic memberNegYAxis
Represents the negative Y direction
Public fieldStatic memberNegZAxis
Represents the negative Z direction
Public fieldStatic memberXAxis
Represents the positive X direction
Public fieldStatic memberXYZAxis
Represents the Identity vector
Public fieldStatic memberYAxis
Represents the positive Y direction
Public fieldStatic memberZAxis
Represents the positive Z direction
Public fieldStatic memberZeroMatrix
Represents the zero matrix
Public fieldStatic memberZeroVector
Represents the zero vector

See Also