POV-Ray : Newsgroups : povray.general : mathematically description of a sphere Server Time
9 Aug 2024 17:23:10 EDT (-0400)
  mathematically description of a sphere (Message 1 to 3 of 3)  
From: Remco Poelstra
Subject: mathematically description of a sphere
Date: 25 Jun 2000 08:04:14
Message: <39564A23.A77155D7@home.nl>
Hi,

How is a sphere mathematically described? I mean in a way like this:
a line: <x,y,z>=<x,y,z>+t*<x,y,z>
a plane: <x,y,z>=<x,y,z>+t*<x,y,z>+u*<x,y,z>

Remco Poelstra


Post a reply to this message

From: Christoph Hormann
Subject: Re: mathematically description of a sphere
Date: 25 Jun 2000 08:24:02
Message: <3955F9E3.5C6E6E7E@schunter.etc.tu-bs.de>
Remco Poelstra wrote:
> 
> Hi,
> 
> How is a sphere mathematically described? I mean in a way like this:
> a line: <x,y,z>=<x,y,z>+t*<x,y,z>
> a plane: <x,y,z>=<x,y,z>+t*<x,y,z>+u*<x,y,z>
> 
> Remco Poelstra

It is not that common to describe a sphere this way (would require
cos/sin) so right now I really do not know it (anybody else ?).  

Most common (and usable for isosurfaces) is:

x*x + y*y + z*z = r*r    (r=sphere radius)

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Adam Coffman
Subject: Re: mathematically description of a sphere
Date: 25 Jun 2000 15:08:43
Message: <395658C1.418A4714@ipfw.edu>
Remco Poelstra wrote:
> 
> Hi,
> 
> How is a sphere mathematically described? I mean in a way like this:
> a line: <x,y,z>=<x,y,z>+t*<x,y,z>
> a plane: <x,y,z>=<x,y,z>+t*<x,y,z>+u*<x,y,z>
> 
> Remco Poelstra


There are lots of different "parametric equations" for the unit sphere
centered at the origin in (X,Y,Z) space.  Here's a few, with (X,Y,Z)
depending on parameters u,v.  (trig functions using radians)


> X:=2*u/(u^2+v^2+1);
> Y:=2*v/(u^2+v^2+1);
> Z:=(u^2+v^2-1)/(u^2+v^2+1);
domain: u,v all reals


> X:=2*v*sin(u)*sqrt(1-v^2);
> Y:=2*v*cos(u)*sqrt(1-v^2);
> Z:=1-2*v^2;
domain: u=0..2*Pi,v=0..1


> X:=sin(v)*cos(u);
> Y:=sin(v)*sin(u);
> Z:=cos(v);
domain: u=0..2*Pi,v=0..Pi


> X:=cos(v)*cos(u);
> Y:=cos(v)*sin(u);
> Z:=sin(v);
domain: u=0..2*Pi,v=-Pi/2..Pi/2


The first one is called "stereographic projection," and even if the
parameters u,v assume all real values, it won't cover the whole sphere
--- it misses the north pole (0,0,1).  However, it works well on any
patch of the sphere that avoids the pole, and has the computational
advantage of not involving any radicals or trig functions.

The last three cover the whole sphere, using only a rectangle of
finite area in the parameter space.  The last one is the usual
(u,v)=(longitude,latitude) parametric map.

Adam C.


Post a reply to this message

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