Documentation

Unity Engine

Download Unity

Unity Engine

UnityEngine.MathematicsModule

The Mathematics module is a C# math library especially optimized for use with the Burst compiler. It provides vector types and common math functions with a shader-like syntax. When compiled with Burst, many operations have intrinsics implemented that use SIMD instructions.
Read time 3 minutesLast updated 7 hours ago

Definition

  • Type: Module

Classes

Class

Description

MathClass containing math functions for MinMaxAABB.
mathA static class to contain various math functions and constants.
noiseA static class containing noise functions.
svdClass with methods for computing the Singular Value Decomposition (SVD) of 3x3 matrices.

Structs

Struct

Description

AffineTransformAn affine transformation type.
bool2A 2 component vector of bools.
bool2x2A 2x2 matrix of bools.
bool2x3A 2x3 matrix of bools.
bool2x4A 2x4 matrix of bools.
bool3A 3 component vector of bools.
bool3x2A 3x2 matrix of bools.
bool3x3A 3x3 matrix of bools.
bool3x4A 3x4 matrix of bools.
bool4A 4 component vector of bools.
bool4x2A 4x2 matrix of bools.
bool4x3A 4x3 matrix of bools.
bool4x4A 4x4 matrix of bools.
double2A 2 component vector of doubles.
double2x2A 2x2 matrix of doubles.
double2x3A 2x3 matrix of doubles.
double2x4A 2x4 matrix of doubles.
double3A 3 component vector of doubles.
double3x2A 3x2 matrix of doubles.
double3x3A 3x3 matrix of doubles.
double3x4A 3x4 matrix of doubles.
double4A 4 component vector of doubles.
double4x2A 4x2 matrix of doubles.
double4x3A 4x3 matrix of doubles.
double4x4A 4x4 matrix of doubles.
float2A 2 component vector of floats.
float2x2A 2x2 matrix of floats.
float2x3A 2x3 matrix of floats.
float2x4A 2x4 matrix of floats.
float3A 3 component vector of floats.
float3x2A 3x2 matrix of floats.
float3x3A 3x3 matrix of floats.
float3x4A 3x4 matrix of floats.
float4A 4 component vector of floats.
float4x2A 4x2 matrix of floats.
float4x3A 4x3 matrix of floats.
float4x4A 4x4 matrix of floats.
halfA half precision float that uses 16 bits instead of 32 bits.
half2A 2 component vector of halfs.
half3A 3 component vector of halfs.
half4A 4 component vector of halfs.
int2A 2 component vector of ints.
int2x2A 2x2 matrix of ints.
int2x3A 2x3 matrix of ints.
int2x4A 2x4 matrix of ints.
int3A 3 component vector of ints.
int3x2A 3x2 matrix of ints.
int3x3A 3x3 matrix of ints.
int3x4A 3x4 matrix of ints.
int4A 4 component vector of ints.
int4x2A 4x2 matrix of ints.
int4x3A 4x3 matrix of ints.
int4x4A 4x4 matrix of ints.
MinMaxAABBAxis aligned bounding box (AABB) stored in min and max form.
PlaneA plane represented by a normal vector and a distance along the normal from the origin.
quaternionA quaternion type for representing rotations.
RandomRandom Number Generator based on xorshift. Designed for minimal state (32bits) to be easily embeddable into components. Core functionality is integer multiplication free to improve vectorization on less capable SIMD instruction sets.
RigidTransformA rigid transformation type.
uint2A 2 component vector of uints.
uint2x2A 2x2 matrix of uints.
uint2x3A 2x3 matrix of uints.
uint2x4A 2x4 matrix of uints.
uint3A 3 component vector of uints.
uint3x2A 3x2 matrix of uints.
uint3x3A 3x3 matrix of uints.
uint3x4A 3x4 matrix of uints.
uint4A 4 component vector of uints.
uint4x2A 4x2 matrix of uints.
uint4x3A 4x3 matrix of uints.
uint4x4A 4x4 matrix of uints.