---
title: 使用 mathematics 进行编程
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/zh-cn/engine/6000.0/manual/scripting/object-oriented-development/programming-math
latest_url: https://docs.unity.com/zh-cn/engine/7000.0/manual/scripting/object-oriented-development/programming-math.md
generated_at: 2026-11-16T11:29:05.953Z
locale: zh-cn
---

# 使用 mathematics 进行编程

> 使用 Unity 的数学 API 在应用程序程序中Apply三角函数、对数函数和Other函数，使用矢量Move对象，并Generate随机。

Unity 公开了一些 public API，允许您在代码中使用数学概念。这些 API 可用于操作游戏Development中常见的矢量、矩阵和Other数学结构。

| **主题**                                                                                                      | **描述**                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **[使用矢量移动对象](/engine/6000.0/manual/scripting/object-oriented-development/programming-math/vectors.md)**     | 使用 Unity 的 2D、3D 和 4D 矢量类执行矢量算术，以管理对象的位置和速度以及对象之间的距离。                                                                    |
| **[使用常见数学函数](/engine/6000.0/manual/scripting/object-oriented-development/programming-math/class-mathf.md)** | 使用 Unity 的 [`Mathf`](/engine/6000.0/script-reference/unityengine/mathf.md) 类来 Apply 游戏 Development 中常见的三角函数、对数函数和其他数学函数。 |
| **[使用随机性](/engine/6000.0/manual/scripting/object-oriented-development/programming-math/class-random.md)**   | 使用 [`Random`](/engine/6000.0/script-reference/unityengine/random.md) 类可生成游戏 Development 中常见的各种类型的随机值。                    |

## 其他资源##additional-resources

* [Unity 脚本参考](ScriptRef:index)
* [Unity Mathematics 包](https://docs.unity3d.com/Packages/com.unity.mathematics@latest)
