unity Mathf 数学运算汇总.docVIP

  • 5
  • 0
  • 约8.98千字
  • 约 9页
  • 2016-08-22 发布于河南
  • 举报
unity Mathf 数学运算汇总

在使用unity?做游戏的过程中 难免会遇到这样那样的数学运算,比如简单的正弦,余弦等。 其实,在c#的Mathf 函数中 还有很多方便我们开发使用的 数学函数。 在此,分享下比较全面的Mathf解析(由网上收集),方便大家参考 使用。 Mathf 数学运算 Mathf.Abs绝对值 计算并返回指定参数 f 绝对值。 Mathf.Acos反余弦 static function Acos (f : float) : float 以弧度为单位计算并返回参数 f 中指定的数字的反余弦值。 Mathf.Approximately近似 static function Approximately (a : float, b: float) : bool 比较两个浮点数值,看它们是否非常接近, 由于浮点数值不精确,不建议使用等于来比较它们。例如,1.0==10.0/10.0也许不会返回true。 public class example : MonoBehaviour { ? ?? ?? ?? ?publicvoid Awake() ? ?? ?? ???{ ? ?? ?? ?? ?? ???if(Mathf.Approximately(1.0F, 10.0F / 10.0F)) ? ?? ?? ?? ?? ???print(same); ? ?? ?? ???} } Mathf.Asin反正弦

文档评论(0)

1亿VIP精品文档

相关文档