POV-Ray : Newsgroups : povray.general : Help with plotting a parametric equation : Help with plotting a parametric equation Server Time
31 Jul 2024 02:25:12 EDT (-0400)
  Help with plotting a parametric equation  
From: SharkD
Date: 16 Jan 2008 02:45:00
Message: <web.478db59093155640368884fc0@news.povray.org>
I have gotten in a dispute at Wikipedia
(http://en.wikipedia.org/wiki/Talk:HSL_and_HSV#Sphere). I'm trying to plot the
following parametric formula:

http://img252.imageshack.us/img252/1194/parametricformulaqy3.png

Here's what I've got so far:

#local cone_count_h = 0;
#local cone_count_s = 0;
#local cone_count_l = 0;
#local cone_max_h = 12;
#local cone_max_s = 6;
#local cone_max_l = 6;
#local cone_interval_h = 360/cone_max_h;
#local cone_interval_s =   1/cone_max_s;
#local cone_interval_l =   1/cone_max_l;
#local cone_max_i = 1000;

#while (cone_count_h < cone_max_h)
 #local cone_h = cone_count_h * cone_interval_h;
 #while (cone_count_s < cone_max_s)
  #local cone_s = cone_count_s * cone_interval_s;
  #while (cone_count_l < cone_max_l)
   #local cone_l = cone_count_l * cone_interval_l;
   #local new_var = 2 * cone_l - 1;
   #local f_of_new_var = sqrt(1 - pow(new_var, 2));
   #local x_coo = f_of_new_var * cone_s * cosd(cone_h);
   #local y_coo = f_of_new_var * cone_s * sind(cone_h);
   #local z_coo = new_var;
   sphere
   {
    < x_coo, z_coo, y_coo>, 0.05
    texture
    {
     pigment {rgb <1,0,0>}
     pigment {rgb CHSL2RGB(<cone_h/360, cone_s, cone_l>)}
    }
   }
   #local cone_count_l = cone_count_l + 1;
  #end
  #local cone_count_s = cone_count_s + 1;
 #end
 #local cone_count_h = cone_count_h + 1;
#end

What am I doing wrong?


Post a reply to this message

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