POV-Ray : Newsgroups : povray.general : general geometry question : Re: general geometry question Server Time
7 Aug 2024 15:18:31 EDT (-0400)
  Re: general geometry question  
From: Ben Chambers
Date: 21 Aug 2001 16:13:11
Message: <3b82c0d7@news.povray.org>
"Mark M. Wilson" <mmw### [at] ncsldcrstatencus> wrote in message
news:3B82C002.E75037D3@ncsl.dcr.state.nc.us...
> I have a couple of questions, actually.  The second is dependent on the
> first.
> 1) It's been a LOOONNNNGGGGGG time since high school geometry, but it
> seems to me it should be possible to scribe a circle given any three
> (coplanar) points.  Am I right?
>
> 2) if the premise in #1 is correct, does anyone know of any macros for
> Povray that will calculate the coordinates of  the center of such a
> circle?
>
> TIA,
> Mark M. Wilson

Actually, you can do it with two points. Try this:

#declare P1 = <x1, y1, z1>;
#declare P2 = <x2, y2, z2>;

sphere {
    (P1+P2)/2, sqrt(sqr(x2-x1)+sqr(y2-y1)+sqr(z2-z1))
    texture {stuff}
}


Post a reply to this message

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