POV-Ray : Newsgroups : povray.general : Help with plotting a parametric equation : Re: Help with plotting a parametric equation Server Time
31 Jul 2024 02:24:20 EDT (-0400)
  Re: Help with plotting a parametric equation  
From: Tim Attwood
Date: 16 Jan 2008 06:58:16
Message: <478df158$1@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?
>
The z coordinates are just sqrt(1 - pow(new_var, 2))...
as stated by the parametric you linked, but that is just a
single cone, not a double cone.


Post a reply to this message

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