# Parametric Sphere Explanation

1. Oct 22, 2010

### DorumonSg

The equation for a circle is

x = r cos(u)
y = r sin(u)

Where u is 0 <= u <= 2 pi, because 2 pi is for calculating circle.

While a sphere is

x = r cos(u)cos(v)
y = r sin(v)cos(v)
z = r sin(v)

Where u is the same, 2 pi but v is 0<= v <= 1 pi.

Why only 1 pi for v? and not 2? Why does it not have to turn a full circle?

2. Oct 22, 2010

### fzero

Think about the cross-section of the sphere into the yz-plane. This is a circle and running u from 0 to 2 pi rotates the circle through the entire sphere. Therefore we should only let v range over a semi-circle if we don't want to trace the sphere out twice. So v ranges from 0 to pi.

Similarly, you can compute the volume of a sphere and see explicitly that integrating v from 0 to 2 pi will give you twice the volume of the sphere.

3. Oct 22, 2010

### DorumonSg

Putting it in the layman terms does it mean :

x = r cos(u)
y = r sin(u)

0 <= u <= 2 pi

This is to draw the circle, a ratio of a circle is 2 pi.

x = r cos(u)cos(v)
y = r sin(u)cos(v)
z = r sin(v)

0 <= u <= 2 pi
0 <= v <= pi

The extra stuff is to make the circle "pop up" till it becomes a Sphere.

As its already a circle which is already round, it only needs to "pop up" itself on a straight line(180 degree) to become a Sphere?

If you increase the degree, there will be no visible change(Maybe the some part become thicker in color due to more drawing.) because its all within the 360 degree of the circle?

Is that right?

4. Oct 22, 2010

### fzero

Yes that's a very good way to think about it.

5. Oct 22, 2010

### DorumonSg

I used the formula for a Sphere and I got only half a Sphere :

x=cos(u)*cos(v);
y=sin(u)*cos(v);
z=sin(v);

Basically u = 0.0001 to 6.282 and v = 0.0001 to 3.141, its a piece of programming code but the logic is the same.

Erm..., did I do anything wrong?

6. Oct 22, 2010

### fzero

The volume element is

$$r^2 \sin u ~dr~du~dv$$

and the integral should give $$4\pi R^3/3$$. I'm not sure what you did.

7. Oct 22, 2010

### DorumonSg

Erm... not that, I am trying to define a Sphere using VRML a 3D programming language. My teacher gave us this, its derive from the equation of a Sphere :

parameters [0.0001 6.282 0.0001 3.141]
definition "
x=cos(u)*cos(v);
y=cos(u)*sin(v);
z=sin(u);"

Parameter actually just means u's range is from 0.0001 to 6.282 or 0 <= u <= 2 pi and v is 0.0001 to 3.141 or 0 <= v <= pi

This generates a sphere...

But I find it weird that he is using the range of u as 0 <= u <= 2 pi and v as 0 <= v <= pi.

I tried switching the range for u and v and got half a sphere instead...

Shouldn't u be 0 <= u <= pi and v be 0 <= v <= 2 pi according to the definition of a Sphere :

x = r cos(a)cos(b)
y = r sin(a)cos(b)
z = r sin(b)

Where 0 <= a <= 2 pi and 0 <= b <= pi?

8. Oct 22, 2010

### fzero

Oh, sorry I didn't notice that before. Yes, you're right. If you look at his choice of coordinates and try to compute the volume, you'll actually find zero. So those ranges are not properly spanning the sphere.

9. Oct 22, 2010

### DorumonSg

Thanks a lot.

I think I got it already.

I haven't been looking at the range at an angle point of view.

I think I got it already, thanks a lot.