POV-Ray : Newsgroups : povray.general : Dumb, Stupid, Ignorant geometry question. : Re: Dumb, Stupid, Ignorant geometry question. Server Time
16 Nov 2024 09:22:04 EST (-0500)
  Re: Dumb, Stupid, Ignorant geometry question.  
From: Stephen Lavedas
Date: 2 Sep 1998 11:50:45
Message: <35ED5B8A.A6B5664E@Ragingbull.com>
Let's see.  First off it's 72 degrees for the external angle, the
internal is obtuse, 108 degrees.  BUT, that's besides the point.  The
math you want is in the loop below...

#declare Side = 1;
#declare Angle = 0;
#declare Length = 2;
#declare X = 0
#declare Y = 0
#while (Side <= 5)
       cylinder {
                <X, Y, 0>
                <X + Length * cos(Angle), Y + Length * sin(Angle), 0>,
0.1                 
                pigment {color rgb <1,0,0>}
       }
       #declare Side = Side + 1;
       #declare X = X + Length * cos(Angle);
       #declare Y = Y + Length * sin(Angle);
       #declare Angle = Angle + 72 * 3.14159/180;
#end

though I can't help but think there must be an easier way to do this by
simply using the rotation command from POVRay, here we basically cut out
that middle man (do this with small enough objects and enough iterations
(correcting the angle of course) and you'll get a circle...

Steve


Duane Tackett wrote:
> 
>     Now that I have your attention (with the subject line) I have forgotten
> how to do something seemingly very basic:  I nee to translate a line segment
> into x,y coordinates.  What I need is a 5 sided regular polygon (pentagon in
> english) and I have forgotten the equation to convert this to x,y points.
>     For instance, I want to have a 5 sided object with sides that are 2
> units in length. I have figured out that the degree of the angle between
> each side is 72 (360 degrees divided by 5 sides) but I can't remember the
> equation to translate this.  I don't want the points, I want an explanation
> so I'll have one less silly question to ask.  Let me know if you can help.
> 
> --
> Duane
> 
> Check out my web page.  I just started, so don't laugh too hard.
> www.geocities.com/siliconvalley/lab/8407
> e-mail me: ddt### [at] junocom


Post a reply to this message

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