MCPcopy Create free account
hub / github.com/microsoft/SandDance / fromVector3

Method fromVector3

docs/app/js/sanddance-app.js:75430–75437  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

75428 return this.check();
75429 }
75430 fromVector3(v) {
75431 this.radius = _vec3.length(v);
75432 if (this.radius > 0) {
75433 this.theta = Math.atan2(v[0], v[1]);
75434 this.phi = Math.acos((0, _common.clamp)(v[2] / this.radius, -1, 1));
75435 }
75436 return this.check();
75437 }
75438 toVector3() {
75439 return new (0, _vector3Default.default)(0, 0, this.radius).rotateX({
75440 radians: this.theta

Callers

nothing calls this directly

Calls 1

checkMethod · 0.95

Tested by

no test coverage detected