Class Math
Syntax
Methods
CalculatePerpendicularNormalized(float3, out float3, out float3)
Declaration
public static void CalculatePerpendicularNormalized(float3 v, out float3 p, out float3 q)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Unity.Mathematics.float3 |
p |
|
Unity.Mathematics.float3 |
q |
|
CalculateTwistAngle(quaternion, Int32)
Declaration
public static float CalculateTwistAngle(quaternion q, int twistAxisIndex)
Parameters
Type |
Name |
Description |
Unity.Mathematics.quaternion |
q |
|
Int32 |
twistAxisIndex |
|
Returns
DecomposeRigidBodyOrientation(float4x4)
Physics internally represents all rigid bodies in world space.
If a static body is in a hierarchy, its local-to-world matrix must be decomposed when building the physics world.
This method returns a world-space orientation that would be decomposed for such a rigid body.
Declaration
public static quaternion DecomposeRigidBodyOrientation(in float4x4 localToWorld)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4x4 |
localToWorld |
|
Returns
Type |
Description |
Unity.Mathematics.quaternion |
A world-space orientation as used by physics.
|
DecomposeRigidBodyTransform(float4x4)
Physics internally represents all rigid bodies in world space.
If a static body is in a hierarchy, its local-to-world matrix must be decomposed when building the physics world.
This method returns a world-space RigidTransform that would be decomposed for such a rigid body.
Declaration
public static RigidTransform DecomposeRigidBodyTransform(in float4x4 localToWorld)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4x4 |
localToWorld |
|
Returns
Type |
Description |
Unity.Mathematics.RigidTransform |
A world-space RigidTransform as used by physics.
|
Det(float3, float3, float3)
Declaration
public static float Det(float3 a, float3 b, float3 c)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
a |
|
Unity.Mathematics.float3 |
b |
|
Unity.Mathematics.float3 |
c |
|
Returns
DiagonalizeSymmetricApproximation(float3x3, out float3x3, out float3)
Declaration
public static void DiagonalizeSymmetricApproximation(float3x3 a, out float3x3 eigenVectors, out float3 eigenValues)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3x3 |
a |
|
Unity.Mathematics.float3x3 |
eigenVectors |
|
Unity.Mathematics.float3 |
eigenValues |
|
Dotxyz1(double4, double3)
Declaration
public static double Dotxyz1(double4 lhs, double3 rhs)
Parameters
Type |
Name |
Description |
Unity.Mathematics.double4 |
lhs |
|
Unity.Mathematics.double3 |
rhs |
|
Returns
Dotxyz1(float4, float3)
Declaration
public static float Dotxyz1(float4 lhs, float3 rhs)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4 |
lhs |
|
Unity.Mathematics.float3 |
rhs |
|
Returns
FromToRotation(float3, float3)
Declaration
public static quaternion FromToRotation(float3 from, float3 to)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
from |
|
Unity.Mathematics.float3 |
to |
|
Returns
Type |
Description |
Unity.Mathematics.quaternion |
|
HorizontalMul(float3)
Declaration
public static float HorizontalMul(float3 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Returns
HorizontalMul(float4)
Declaration
public static float HorizontalMul(float4 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4 |
v |
|
Returns
IndexOfMaxComponent(float2)
Declaration
public static int IndexOfMaxComponent(float2 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float2 |
v |
|
Returns
IndexOfMaxComponent(float3)
Declaration
public static int IndexOfMaxComponent(float3 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Returns
IndexOfMaxComponent(float4)
Declaration
public static int IndexOfMaxComponent(float4 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4 |
v |
|
Returns
IndexOfMinComponent(float2)
Declaration
public static int IndexOfMinComponent(float2 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float2 |
v |
|
Returns
IndexOfMinComponent(float3)
Declaration
public static int IndexOfMinComponent(float3 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Returns
IndexOfMinComponent(float4)
Declaration
public static int IndexOfMinComponent(float4 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float4 |
v |
|
Returns
Declaration
public static Math.MTransform Inverse(Math.MTransform a)
Parameters
Returns
IsNormalized(float3)
Declaration
public static bool IsNormalized(float3 v)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Returns
Declaration
public static float3 Mul(Math.MTransform a, float3 x)
Parameters
Returns
Type |
Description |
Unity.Mathematics.float3 |
|
Declaration
public static Math.MTransform Mul(Math.MTransform cFromB, Math.MTransform bFromA)
Parameters
Returns
NextMultipleOf(Int32, Int32)
Declaration
public static int NextMultipleOf(int input, int alignment)
Parameters
Returns
NextMultipleOf(UInt64, UInt64)
Declaration
public static ulong NextMultipleOf(ulong input, ulong alignment)
Parameters
Returns
NextMultipleOf16(Int32)
Declaration
public static int NextMultipleOf16(int input)
Parameters
Type |
Name |
Description |
Int32 |
input |
|
Returns
NextMultipleOf16(UInt64)
Declaration
public static ulong NextMultipleOf16(ulong input)
Parameters
Type |
Name |
Description |
UInt64 |
input |
|
Returns
NormalizeWithLength(float3, out float3)
Declaration
public static float NormalizeWithLength(float3 v, out float3 n)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
v |
|
Unity.Mathematics.float3 |
n |
|
Returns
PlaneFromDirection(float3, float3)
Declaration
public static Plane PlaneFromDirection(float3 origin, float3 direction)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
origin |
|
Unity.Mathematics.float3 |
direction |
|
Returns
PlaneFromTwoEdges(float3, float3, float3)
Declaration
public static Plane PlaneFromTwoEdges(float3 origin, float3 edgeA, float3 edgeB)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
origin |
|
Unity.Mathematics.float3 |
edgeA |
|
Unity.Mathematics.float3 |
edgeB |
|
Returns
RSqrtSafe(Single)
Declaration
public static float RSqrtSafe(float v)
Parameters
Type |
Name |
Description |
Single |
v |
|
Returns
Declaration
public static Aabb TransformAabb(RigidTransform transform, Aabb aabb)
Parameters
Type |
Name |
Description |
Unity.Mathematics.RigidTransform |
transform |
|
Aabb |
aabb |
|
Returns
Declaration
public static Aabb TransformAabb(Math.MTransform transform, Aabb aabb)
Parameters
Returns
Declaration
public static Plane TransformPlane(RigidTransform transform, Plane plane)
Parameters
Type |
Name |
Description |
Unity.Mathematics.RigidTransform |
transform |
|
Plane |
plane |
|
Returns
Declaration
public static Plane TransformPlane(Math.MTransform transform, Plane plane)
Parameters
Returns
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.