POV-Ray : Newsgroups : povray.general : Some simple geometric puzzles : Re: Some simple geometric puzzles Server Time
30 Jul 2024 08:29:37 EDT (-0400)
  Re: Some simple geometric puzzles  
From: Reactor
Date: 8 Jun 2009 18:15:00
Message: <web.4a2d8cadd1236d666e92a2670@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> To be solved with SDL. No #includes, though. And of course the simpler
> the answer, the better. Try to solve these before looking at other people's
> answers... :)
>
> 1) Transform a "box { 0, 1 }" with one single 'rotate' so that the box
>    corner at <1,1,1> ends up exactly on the y axis.
>
> 2) Create 4 spheres of the same size so that 3 of them are sitting on
>    the x-z plane, each one touching the other two at one single point,
>    and the 4th sphere is on top of the three, touching all these other
>    three spheres at one single point each.
>
> 3) Add a fifth, smaller sphere to the previous scene so that it touches
>    all the four larger spheres at a single point each.
>
>   Commented code is preferable. :)
>
> --
>                                                           - Warp



For the second one:

#local rad = 1;
union
{
 sphere{ <0, rad*sqrt(8/3), 0>,  rad   } // top one

// the other spheres are laid out as corners of an equilateral triangle.
// all start at the +z distance away from the center of the triangle (the
origin)
// the spheres are then rotated into place
 sphere{ <0, 0, rad*2/3*sqrt(3)>,  rad   rotate <0,   0,0> }
 sphere{ <0, 0, rad*2/3*sqrt(3)>,  rad   rotate <0, 120,0> }
 sphere{ <0, 0, rad*2/3*sqrt(3)>,  rad   rotate <0,-120,0> }

translate <0,rad,0> // move up to x-z plane
pigment{ color rgb <0.5,1.0,0.5> }
}


I *think* I can think of one for the third, but I can't finish it now.

-Reactor


Post a reply to this message

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