docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Unity Mathematics

    Unity Mathematics is a C# math library that provides vector types and math functions that have a shader-like syntax, similar to SIMD or HLSL. The Burst compiler uses Unity Mathematics to compile C#/IL code into highly efficient native code.

    It implements the following vector and matrix types:

    • floatN, quaternion
    • float3×3, float4×4

    Plus elementary functions:

    • min, max, fabs, etc.
    • sin, cos, sqrt, normalize, dot, cross, etc.

    Installation

    You can install the Mathematics package through Unity's Package Manager. For more information, see the Unity User Manual documentation on Adding and removing packages.

    Editor config

    Unity Mathematics uses editorconfig to keep files formatted for EOL and spaces.

    Your IDE should have support for editorconfig. If it doesn't, you can get the extension for it here:

    • VS2015/VS2017 EditorConfig extension
    • Visual Studio Code EditorConfig extension
    • SublimeText EditorConfig extension
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)