Created
May 19, 2016 12:07
-
-
Save Fohlen/f8f2146a760bbaf6b3b3617aad184b86 to your computer and use it in GitHub Desktop.
Calculate the amount of rows in a borderless square (x/y angles) to draw a triangle
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 sequence2D(n) { | |
if (n > 1) { | |
return this.sequence2D(n - 1) + (n + 1); | |
} else if (n == 1) { | |
return 3; | |
} else { | |
throw new RangeError("A sequence operates on real numbers."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment