Created
March 18, 2019 21:31
-
-
Save teoyoung/6157f3fc446f75310f3ed908137db287 to your computer and use it in GitHub Desktop.
Math
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let radius = 200; | |
let separation = 10; | |
for ( var s = 0; s <= 180; s+=separation ) { | |
var radianS = s*Math.PI / 180; | |
var pZ = radius * Math.cos(radianS); | |
for ( var t = 0; t < 360; t+=separation ) { | |
var radianT = t*Math.PI / 180; | |
var pX = radius* Math.sin(radianS) * Math.cos(radianT); | |
var pY = radius* Math.sin(radianS) * Math.sin(radianT); | |
let date = { | |
point: { x: pX, y: pY, z: pZ }, | |
stars: [{ x: 0, y: 0, z: 0 },{ x: 0, y: 0, z: 0 }] | |
}; | |
this.memory_stars.push( date ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment