(i, count)
| 88 | } |
| 89 | |
| 90 | function createTorus(i, count) { |
| 91 | // Torus parameters |
| 92 | const R = 30; // Major radius (distance from center of tube to center of torus) |
| 93 | const r = 10; // Minor radius (radius of the tube) |
| 94 | |
| 95 | // Use a uniform distribution on the torus surface |
| 96 | // by using uniform sampling in the 2 angle parameters |
| 97 | const u = (i / count) * 2 * Math.PI; // Angle around the center of the torus |
| 98 | const v = (i * Math.sqrt(5)) * 2 * Math.PI; // Angle around the tube |
| 99 | |
| 100 | // Parametric equation of a torus |
| 101 | return new THREE.Vector3( |
| 102 | (R + r * Math.cos(v)) * Math.cos(u), |
| 103 | (R + r * Math.cos(v)) * Math.sin(u), |
| 104 | r * Math.sin(v) |
| 105 | ); |
| 106 | } |
| 107 | |
| 108 | function createVortex(i, count) { |
| 109 | // Vortex parameters |
nothing calls this directly
no outgoing calls
no test coverage detected