Download node_modules/three/src/math/Cylindrical.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 953 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/math/Cylindrical.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/src/math/Cylindrical.js
-
curl -L -o Cylindrical.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/math/Cylindrical.js
953 Bytes
| /** | |
| * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system | |
| */ | |
| class Cylindrical { | |
| constructor( radius = 1, theta = 0, y = 0 ) { | |
| this.radius = radius; // distance from the origin to a point in the x-z plane | |
| this.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis | |
| this.y = y; // height above the x-z plane | |
| return this; | |
| } | |
| set( radius, theta, y ) { | |
| this.radius = radius; | |
| this.theta = theta; | |
| this.y = y; | |
| return this; | |
| } | |
| copy( other ) { | |
| this.radius = other.radius; | |
| this.theta = other.theta; | |
| this.y = other.y; | |
| return this; | |
| } | |
| setFromVector3( v ) { | |
| return this.setFromCartesianCoords( v.x, v.y, v.z ); | |
| } | |
| setFromCartesianCoords( x, y, z ) { | |
| this.radius = Math.sqrt( x * x + z * z ); | |
| this.theta = Math.atan2( x, z ); | |
| this.y = y; | |
| return this; | |
| } | |
| clone() { | |
| return new this.constructor().copy( this ); | |
| } | |
| } | |
| export { Cylindrical }; | |