setFromCartesianCoords method
Implementation
Spherical setFromCartesianCoords(double x, double y, double z) {
radius = math.sqrt(x * x + y * y + z * z);
if (radius == 0) {
theta = 0;
phi = 0;
} else {
theta = math.atan2(x, z);
phi = math.acos(MathUtils.clamp(y / radius, -1, 1));
}
return this;
}