MCPcopy Create free account
hub / github.com/collidingScopes/iron-interface / createSphere

Function createSphere

geometry.js:38–52  ·  view source on GitHub ↗
(i, count)

Source from the content-addressed store, hash-verified

36}
37
38function createSphere(i, count) {
39 // Sphere distribution using spherical coordinates for surface only
40 const t = i / count;
41 const phi = Math.acos(2 * t - 1); // Full range from 0 to PI
42 const theta = 2 * Math.PI * (i / count) * Math.sqrt(count); // Golden ratio distribution
43
44 // Fixed radius for surface-only distribution
45 const radius = 30;
46
47 return new THREE.Vector3(
48 Math.sin(phi) * Math.cos(theta) * radius,
49 Math.sin(phi) * Math.sin(theta) * radius,
50 Math.cos(phi) * radius
51 );
52}
53
54function createSpiral(i, count) {
55 const t = i / count;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected