POV-Ray : Newsgroups : povray.binaries.images : Permutations Server Time
19 Jul 2024 11:29:50 EDT (-0400)
  Permutations (Message 1 to 1 of 1)  
From: Bald Eagle
Subject: Permutations
Date: 26 Jan 2024 00:00:00
Message: <web.65b33b7b3d0736481f9dae3025979125@news.povray.org>
I had been doing some work that required knowing how many permutations there
were of a set containing N elements.

That can be done with Heap's algorithm.
(I used the non-recursive version, because the recursive one was way too
confusing, and I couldn't get it to work)

I decided to see what that would look like using colors.

<0, 0, 0>, x, y, z, x+y, x+z, y+z, <1, 1, 1> has 40320 permutations.
And with sphere radii of 0.75, they just barely fit into a 1920 x 1080 render.

- BW

Post a reply to this message

Download 'permutations.png' (3080 KB)

Preview of image 'permutations.png'


Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.