The Simplest N-Dimensional shape one can create for any dimension is a Simplex, and this is a set of N+1 points that are all equal distance away from eachother.
For 2 dimensions, this is an equilateral triangle, for 3 dimensions, this is an regular tetrahedron, at 4 dimensions is the 5-Cell and so on.
The Challenge
Given an Integer dimension N as input, output an Array/List/Stack/Whatever of N Dimensional points that represent a Simplex of this dimension. That is, N+1 vertexes that are equal and non-zero distance from eachother.
Reference implementation in Lua
Examples
1 -> [[0], [1]] 2 -> [[0, 0], [1, 0], [0.5, 0.866...]] 4 -> [[0, 0, 0, 0], [1, 0, 0, 0], [0.5, 0.866..., 0, 0], [0.5, 0.288..., 0.816..., 0], [0.5, 0.288..., 0.204..., 0.790...]] Notes
- Input is a number in any standard format, and will always be an integer greater than 1 and less than 10
- Hardcoding is allowed for input of 1, but nothing higher.
- Reasonable error is allowed in the output. Issues with floating point arithmetic or trig may be ignored.
- Any transformation of the N dimensional simplex is allowed, aslong as it remains Regular and Non-zero.
- Standard Loopholes are forbidden.
- This is code-golf, so fewest bytes wins.