MathUtils

Overview

MathUtils 是一个类在Java的FOSS中.

有数学函数的实用类.

本类提供了11种方法,用于在Java程序中使用MathUtils 对象. 有的方法包括: calcNormal, clamp, findIntersection, pointInsideTriangle, rayIntersect, toDegree, toRadian. 所有公众成员在安装了Java的FOSS包后,可以访问任何 Java应用程序.

Methods

SignatureDescription
calcNormal(points: Vector3[])Vector3从三个点计算正常向量.
findIntersection(p0: Vector2, d0: Vector2, p1: Vector2, d1: Vector2, results: Vector2[])int在二维空间中找到两条线的交点.
pointInsideTriangle(p: Vector2, p0: Vector2, p1: Vector2, p2: Vector2)boolean检查一个点是否在三角形内.
rayIntersect(origin: Vector2, dir: Vector2, a: Vector2, b: Vector2)Vector2在二维空间中找到射线和线段的交点.
clamp(val: double, min: double, max: double)double取最小至最大的值.
toDegree(radian: Vector3)Vector3将半径转换为度.
toRadian(degree: Vector3)Vector3将度转换为半径.
toDegree(radian: double)double将半径转换为度.
toRadian(degree: double)double将度转换为半径.
toDegree(x: double, y: double, z: double)Vector3将半径转换为度.
toRadian(x: double, y: double, z: double)Vector3将度转换为半径.

See Also

 中文