← 返回首页

SIGNAL · POST

Spherical球坐标

约 2 分钟阅读 bajiu 前端

一个点的spherical coordinates(球坐标)。

数学中通常使用的球坐标 (r, θ, φ) :徑向距離 r,方位角 θ(theta)与极角 φ(phi)。

构造函数

Spherical( radius : Float, phi : Float, theta : Float )

  • radius - 半径值,或者说从该点到原点的 Euclidean distance(欧几里得距离,即直线距离)。默认值为1.0。
  • phi - 与y轴(上)的极角。默认值为0。(polar angle from the y (up) axis. Default is 0.)
  • theta - 绕y轴(向上)的赤道角。默认值为0。(equator angle around the y (up) axis. Default is 0.)

方法

.clone () : Spherical

返回一个新的球坐标,新的球坐标与该球坐标具有相同的 radiusphitheta

.copy ( s : Spherical ) : Spherical

复制所传入的球坐标的radius、 phi 和theta属性到该球坐标中。

.makeSafe () : Spherical

将极角 phi 的值限制在0.000001 和 pi - 0.000001 之间。

.set ( radius : Float, phi : Float, theta : Float ) : Spherical

设置球坐标中radiusphitheta 属性的值。

.setFromVector3 ( vec3 : Vector3 ) : Spherical

Vector3中设置球坐标的radiusphitheta值。

.setFromCartesianCoords ( x : Float, y : Float, z : Float ) : Spherical

从笛卡尔坐标系中设置球坐标的radiusphitheta值。

源代码

src/math/Spherical.js