Skip to main content
added 51 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

Jelly,  18  17 bytes

...or 15 with repeats - remove µQ.

Ø+ṗ3µØpİƬŻṙJ×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ×€jµQ - Link: no arguments Ø+ - [1, -1] 3 - three ṗ - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ µ - monadic chain - f(CubePoints): Øp - phi Ƭ - collect up while distinct under: İ - inverse Ż - prefix with zero -> [0, phi, 1/phi] J - range of length {CubePoints} -> [1, 2, 3, 4, 5, 6, 7, 8] ṙ - rotate {[0, phi, 1/phi]} left by (vectorises) {that} -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi], ...(8)] € - for each (rotation): × - multiply by {CubePoints} (vectorises) j - join {that list of lists of triples} with {CubePoints} Q - deduplicate 

Jelly,  18  17 bytes

Ø+ṗ3µØpİƬŻṙJ×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ×€jµQ - Link: no arguments Ø+ - [1, -1] 3 - three ṗ - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ µ - monadic chain - f(CubePoints): Øp - phi Ƭ - collect up while distinct under: İ - inverse Ż - prefix with zero -> [0, phi, 1/phi] J - range of length {CubePoints} -> [1, 2, 3, 4, 5, 6, 7, 8] ṙ - rotate {[0, phi, 1/phi]} left by (vectorises) {that} -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi], ...(8)] € - for each (rotation): × - multiply by {CubePoints} (vectorises) j - join {that list of lists of triples} with {CubePoints} Q - deduplicate 

Jelly,  18  17 bytes

...or 15 with repeats - remove µQ.

Ø+ṗ3µØpİƬŻṙJ×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ×€jµQ - Link: no arguments Ø+ - [1, -1] 3 - three ṗ - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ µ - monadic chain - f(CubePoints): Øp - phi Ƭ - collect up while distinct under: İ - inverse Ż - prefix with zero -> [0, phi, 1/phi] J - range of length {CubePoints} -> [1, 2, 3, 4, 5, 6, 7, 8] ṙ - rotate {[0, phi, 1/phi]} left by (vectorises) {that} -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi], ...(8)] € - for each (rotation): × - multiply by {CubePoints} (vectorises) j - join {that list of lists of triples} with {CubePoints} Q - deduplicate 
added 33 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

Jelly, 18 18  17 bytes

Ø+ṗ3µØpİƬŻṙJ$×€jµQØ+ṗ3µØpİƬŻṙJ×€jµQ 

A niladic Link that yields a list of triples.

Try it online!Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ$×€jµQØ+ṗ3µØpİƬŻṙJ×€jµQ - Link: no arguments Ø+  - [1, -1] 3  - three ṗ  - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ  µ - monadic chain - f(CubePoints): Øp  - phi Ƭ  - collect up while distinct under: İ  - inverse Ż  - prefix with zero -> [0, phi, 1/phi]   $J - lastrange twoof linkslength as{CubePoints} a-> monad: [1, 2, 3, 4, 5, 6, 7, 8]  J  - range- of length ->rotate [1{[0, 2phi, 3] 1/phi]} left by (vectorises) {that}   - rotate left by (vectorises) -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi]] phi], ...(8)]  € - for each (rotation):   × - multiply by {CubePoints} (vectorises)   j - join {that list of lists of triples} with {CubePoints}   Q - deduplicate 

Jelly, 18 bytes

Ø+ṗ3µØpİƬŻṙJ$×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ$×€jµQ - Link: no arguments Ø+  - [1, -1] 3  - three ṗ  - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ  µ - monadic chain - f(CubePoints): Øp  - phi Ƭ  - collect up while distinct under: İ  - inverse Ż  - prefix with zero -> [0, phi, 1/phi]   $ - last two links as a monad:  J - range of length -> [1, 2, 3]   - rotate left by (vectorises) -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi]]  € - for each (rotation):   × - multiply by {CubePoints} (vectorises)   j - join {that list of lists of triples} with {CubePoints}   Q - deduplicate 

Jelly,  18  17 bytes

Ø+ṗ3µØpİƬŻṙJ×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ×€jµQ - Link: no arguments Ø+ - [1, -1] 3 - three ṗ - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ µ - monadic chain - f(CubePoints): Øp - phi Ƭ - collect up while distinct under: İ - inverse Ż - prefix with zero -> [0, phi, 1/phi] J - range of length {CubePoints} -> [1, 2, 3, 4, 5, 6, 7, 8]   - rotate {[0, phi, 1/phi]} left by (vectorises) {that}  -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi], ...(8)]  € - for each (rotation): × - multiply by {CubePoints} (vectorises) j - join {that list of lists of triples} with {CubePoints} Q - deduplicate 
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

Jelly, 18 bytes

Ø+ṗ3µØpİƬŻṙJ$×€jµQ 

A niladic Link that yields a list of triples.

Try it online!

How?

Produces the twenty triples as shown on Wikipedia:

$$(\pm 1, \pm 1, \pm 1)$$ $$(0, \pm \phi, \pm \phi^{-1})$$ $$(\pm \phi^{-1}, 0, \pm \phi)$$ $$(\pm \phi, \pm \phi^{-1}, 0)$$

Ø+ṗ3µØpİƬŻṙJ$×€jµQ - Link: no arguments Ø+ - [1, -1] 3 - three ṗ - Cartesian power -> (+/-1, +/-1, +/-1) "CubePoints" µ µ - monadic chain - f(CubePoints): Øp - phi Ƭ - collect up while distinct under: İ - inverse Ż - prefix with zero -> [0, phi, 1/phi] $ - last two links as a monad: J - range of length -> [1, 2, 3] ṙ - rotate left by (vectorises) -> [[phi, 1/phi, 0], [1/phi, 0, phi], [0, phi, 1/phi]] € - for each (rotation): × - multiply by {CubePoints} (vectorises) j - join {that list of lists of triples} with {CubePoints} Q - deduplicate