Created
October 25, 2020 20:57
-
-
Save Sixl-Daniel/d9075be7fe2bea563ad5788af480f84c to your computer and use it in GitHub Desktop.
Useful functions JS
This file contains 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
function calculateGoldenRatio(length) { | |
const phi = 1.6180339887498948; | |
const a = Math.round(length / phi) | |
const b = length - a; | |
return { a: a, b: b }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment