EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

[Unity]什么是Mathf.Atan2函数?

Mathf

 

public static float Atan2(float y,float x);

 

返回以弧度表示的角度,其Tan为y/x。

 

代码:

Debug

45°的弧度:

弧度

Debug测试:

完全一致

 

完全一致

 

 

 

扩展阅读:

[1] [Unity]从零开始认识C#脚本——以第三人称控制器为例

 

参考文档:

[1] [Unity3D日常] Mathf.Atan2函数研究

[2] Unity官方文档—Mathf.Atan2

 

This article was last edited at 2020-04-07 18:11:45

* *