# Unity Engine math APIs

> Use the collection of math APIs in the Unity.Engine namespace to access common mathematical operations.

The `UnityEngine` includes math APIs best-suited for use in projects that are just-in-time (JIT) compiled with the [Mono scripting backend](/engine/6000.6/manual/scripting/compilation-and-code-reload/script-compilation/backends/mono.md). This includes the [`Mathf`](/engine/6000.6/script-reference/unityengine/mathf.md) class for common math functions, including trignomometric, logarithmic, and other oprations. It also includes classes for data structures such as [`Vector2`](/engine/6000.6/script-reference/unityengine/vector2.md), [`Vector3`](/engine/6000.6/script-reference/unityengine/vector3.md), [`Matrix4x4`](/engine/6000.6/script-reference/unityengine/matrix4x4.md), [`Quaternion`](/engine/6000.6/script-reference/unityengine/quaternion.md), and [`UnityEngine.Random`](/engine/6000.6/script-reference/unityengine/random.md).

The `UnityEngine` math APIs are recommended for code that is not [Burst compiled](/engine/6000.6/manual/scripting/compilation-and-code-reload/script-compilation/burst.md). In Burst compiled code, use the [Unity.Mathematics](/engine/6000.6/manual/scripting/programming-math/unity-mathematics.md) APIs instead, which are optimized for Burst compilation.

| **Topic**                                                                                                                                    | **Description**                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **[Common math functions with the Mathf class](/engine/6000.6/manual/scripting/programming-math/unity-engine-math/class-mathf.md)**          | Use Unity's [`Mathf`](/engine/6000.6/script-reference/unityengine/mathf.md) class to apply trigonometric, logarithmic, and other math functions commonly required in game development. |
| **[Moving objects with the Vector classes](/engine/6000.6/manual/scripting/programming-math/unity-engine-math/vectors.md)**                  | Perform vector arithmetic with Unity's 2D, 3D, and 4D vector classes to manage the position and speed of objects and the distance between them.                                        |
| **[Generating random numbers with the Random class](/engine/6000.6/manual/scripting/programming-math/unity-engine-math/class-random.md)**    | Use the [`Random`](/engine/6000.6/script-reference/unityengine/random.md) class to generate various types of random values commonly required in game development.                      |
| **[Controlling rotation with the Quaternion class](/engine/6000.6/manual/scripting/programming-math/unity-engine-math/class-quaternion.md)** | Use euler angles or quaternions in Unity's left hand coordinate system to control the rotation and orientation of GameObjects.                                                         |

## Additional resources

* [Unity Mathematics APIs](/engine/6000.6/manual/scripting/programming-math/unity-mathematics.md)
