Created
April 10, 2021 06:54
-
-
Save Reine0017/e2fdb4edb07247f314cb5191bc427bce to your computer and use it in GitHub Desktop.
Calculate and Create Coordinate Arrays for Helix
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
| //Note that this isn't the full code for this js file, please refer to the repo for the full code | |
| const linspaceFn = (startValue, stopValue, cardinality) => { | |
| var arr = []; | |
| var step = (stopValue - startValue) / (cardinality - 1); | |
| for (var i = 0; i < cardinality; i++) { | |
| arr.push(parseFloat((startValue + (step * i)).toFixed(3))); | |
| } | |
| return arr; | |
| } | |
| const t = linspaceFn(0, 20, 100) | |
| const x = t.map(i => (Math.cos(i))) | |
| const y = t.map(i => Math.sin(i)) | |
| const z = t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment