rss
Twitter Delicious Facebook Digg Stumbleupon Favorites

Friday, October 7, 2011

Find the area and volume of a sphere

A sphere is a perfectly round geometrical object in three-dimensional space, such as the shape of a round ball. Like a circle in two dimensions, a perfect sphere is completely symmetrical around its center, with all points on the surface lying the same distance r from the center point. This distance r is known as the radius of the sphere. The maximum straight distance through the sphere is known as the diameter of the sphere. It passes through the center and is thus twice the radius.
In higher mathematics, a careful distinction is made between the sphere (a two-dimensional spherical surface embedded in three-dimensional Euclidean space) and the ball (the three-dimensional shape consisting of a sphere and its interior).
In 3 dimensions, the volume inside a sphere (that is, the volume of a ball) is given by the formula
\!V = \frac{4}{3}\pi r^3
where r is the radius of the sphere and π is the constant pi. This formula was first derived by Archimedes, who showed that the volume of a sphere is 2/3 that of a circumscribed cylinder. (This assertion follows from Cavalieri's principle.) In modern mathematics, this formula can be derived using integral calculus, e.g.disk integration to sum the volumes of an infinite number of circular disks of infinitesimal thickness stacked centered side by side along the x axis from x = 0where the disk has radius r (i.e. y = r) to x = r where the disk has radius 0 (i.e. y = 0).
At any given x, the incremental volume (δV) is given by the product of the cross-sectional area of the disk at x and its thickness (δx):
\!\delta V \approx \pi y^2 \cdot \delta x.
The total volume is the summation of all incremental volumes:
\!V \approx \sum \pi y^2 \cdot \delta x.
In the limit as δx approaches zero this becomes:
\!V = \int_{-r}^{r} \pi y^2 dx.
At any given x, a right-angled triangle connects x, y and r to the origin, hence it follows from Pythagorean theorem that:
\!r^2 = x^2 + y^2.
Thus, substituting y with a function of x gives:
\!V = \int_{-r}^{r} \pi (r^2 - x^2)dx.
This can now be evaluated:
\!V = \pi \left[r^2x - \frac{x^3}{3} \right]_{-r}^{r} = \pi \left(r^3 - \frac{r^3}{3} \right) - \pi \left(-r^3 + \frac{r^3}{3} \right) = \frac{4}{3}\pi r^3.
Therefore the volume of a sphere is:
\!V = \frac{4}{3}\pi r^3.
Alternatively this formula is found using spherical coordinates, with volume element
\mathrm{d}V=r^2\sin\theta\,\mathrm{d}r\,\mathrm{d}\theta\,\mathrm{d}\varphi
In higher dimensions, the sphere (or hypersphere) is usually called an n-ball. General recursive formulas exist for deriving the volume of an n-ball.
For most practical uses, the volume of a sphere can be approximated as 52.4% of the volume of an inscribing cube, since \pi/6 \approx 0.5236. For example, since a cube with edge length 1 m has a volume of 1 m3, a sphere with diameter 1 m has a volume of about 0.524 m3.
The surface area of a sphere is given by the following formula
\!A = 4\pi r^2.
This formula was first derived by Archimedes, based upon the fact that the projection to the lateral surface of a circumscribing cylinder (i.e. the Lambert cylindrical equal-area projection) is area-preserving. It is also the derivative of the formula for the volume with respect to r because the total volume of a sphere of radius r can be thought of as the summation of the surface area of an infinite number of spherical shells of infinitesimal thickness concentrically stacked inside one another from radius 0 to radius r. At infinitesimal thickness the discrepancy between the inner and outer surface area of any given shell is infinitesimal and the elemental volume at radius r is simply the product of the surface area at radius r and the infinitesimal thickness.
At any given radius r, the incremental volume (δV) is given by the product of the surface area at radius r (A(r)) and the thickness of a shell (δr):
\delta V \approx A(r) \cdot \delta r. \,
The total volume is the summation of all shell volumes:
V \approx \sum A(r) \cdot \delta r.
In the limit as δr approaches zero this becomes:
V = \int_0^r A(r) \, dr.
Since we have already proved what the volume is, we can substitute V:
\frac{4}{3}\pi r^3 = \int_0^r A(r) \, dr.
Differentiating both sides of this equation with respect to r yields A as a function of r:
\!4\pi r^2 = A(r).
Which is generally abbreviated as:
\!A = 4\pi r^2.
Alternatively, the area element on the sphere is given in spherical coordinates by dA = r^2 \sin\theta\, d\theta\, d\phi.. With Cartesian coordinates, the area element dS=\frac{r}{\sqrt{r^{2}-\sum_{i\ne k}x_{i}^{2}}}\Pi_{i\ne k}dx_{i},\;\forall k. More generally, see area element.
The total area can thus be obtained by integration:
A = \int_0^{2\pi} \int_0^\pi r^2 \sin\theta \, d\theta \, d\phi = 4\pi r^2.


class Sphere{
 String name;
     double p=3.141592654;
     double r=4;
     double h=5;
     double l=6;
 void calculate(){
  System.out.println(4*p*r*r);
 }
 void calculate1(){
  System.out.println((p*r*r*r)*4/3);
 }
}
class CalS{
 public static void main(String args[]){
  Sphere s1=new Sphere();
  s1.name="Sphere-Area";
  System.out.println(s1.name);
  s1.calculate();

 Sphere s2=new Sphere();
  s2.name="Sphere-Volume";
  System.out.println(s2.name);
  s2.calculate1();
    }
}

0 comments:

Post a Comment

Powered by Blogger.