## org.jscience.mathematics.geometry Class CenterOfMasses

```java.lang.Object
org.jscience.mathematics.geometry.CenterOfMasses
```

`public class CenterOfMassesextends java.lang.Object`

A class representing common perimeters, areas, volumes, center of mass (barycenter or gravity center) for various polygons.

Constructor Summary
`CenterOfMasses()`

Method Summary
`static Point2D` ```getBarycenter(Point2D[] positions, double[] masses)```
Gets barycenter for a group of masses and their associated weight
`static Point3D` ```getBarycenter(Point3D[] positions, double[] masses)```
Gets barycenter for a group of masses and their associated weight
`static double` `getCirclePerimeter(double radius)`
Gets perimeter for a circle
`static double` `getCircleSurface(double radius)`
Gets surface for a circle
`static double` ```getConeSurface(double radius, double height)```
Gets surface for a cone
`static double` ```getConeVolume(double radius, double height)```
Gets volume for a cone
`static double` `getCubeSurface(double edge)`
Gets volume for a cube
`static double` `getCubeVolume(double edge)`
Gets volume for a cube
`static double` ```getCylinderSurface(double radius, double height)```
Gets surface for a cylinder
`static double` ```getCylinderVolume(double radius, double height)```
Gets volume for a cylinder
`static double` ```getEllipseSurface(double shortRadius, double longRadius)```
Gets surface for a ellipse
`static double` ```getEllipsoidVolume(double radius1, double radius2, double radius3)```
Gets volume for an ellipsoid
`static double` ```getParallelogramSurface(double base, double height)```
Gets surface for a parallelogram
`static double` ```getPyramidSurface(double base, double height)```
Gets surface for a pyramid
`static double` ```getPyramidVolume(double base, double height)```
Gets volume for a pyramid
`static double` ```getRectanglePerimeter(double shortEdge, double longEdge)```
Gets perimeter for a rectangle
`static double` ```getRectangleSurface(double shortEdge, double longEdge)```
Gets surface for a rectangle
`static double` ```getRectangularPrismSurface(double edge1, double edge2, double edge3)```
Gets surface for a rectangular prism
`static double` ```getRectangularPrismVolume(double edge1, double edge2, double edge3)```
Gets volume for a rectangular prism
`static double` `getSphereSurface(double radius)`
Gets surface for a sphere
`static double` `getSphereVolume(double radius)`
Gets volume for a sphere
`static double` `getSquarePerimeter(double edge)`
Gets perimeter for a square
`static double` `getSquareSurface(double edge)`
Gets surface for a square
`static double` `getTetrahedronSurface(double edge)`
Gets surface for a regular tetrahedron
`static double` `getTetrahedronVolume(double edge)`
Gets volume for a regular tetrahedron
`static double` ```getTrapezoidSurface(double longEdge, double shortEdge, double height)```
Gets surface for a trapezoid
`static double` ```getTrianglePerimeter(double edge1, double edge2, double edge3)```
Gets perimeter for a triangle
`static double` ```getTriangleSurface(double base, double height)```
Gets surface for a triangle

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CenterOfMasses

`public CenterOfMasses()`
Method Detail

### getBarycenter

```public static Point2D getBarycenter(Point2D[] positions,
double[] masses)```
Gets barycenter for a group of masses and their associated weight

Parameters:
`positions` - DOCUMENT ME!
`masses` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getBarycenter

```public static Point3D getBarycenter(Point3D[] positions,
double[] masses)```
Gets barycenter for a group of masses and their associated weight

Parameters:
`positions` - DOCUMENT ME!
`masses` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getSquarePerimeter

`public static double getSquarePerimeter(double edge)`
Gets perimeter for a square

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getRectanglePerimeter

```public static double getRectanglePerimeter(double shortEdge,
double longEdge)```
Gets perimeter for a rectangle

Parameters:
`shortEdge` - DOCUMENT ME!
`longEdge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getTrianglePerimeter

```public static double getTrianglePerimeter(double edge1,
double edge2,
double edge3)```
Gets perimeter for a triangle

Parameters:
`edge1` - DOCUMENT ME!
`edge2` - DOCUMENT ME!
`edge3` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCirclePerimeter

`public static double getCirclePerimeter(double radius)`
Gets perimeter for a circle

Parameters:
`radius` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getSquareSurface

`public static double getSquareSurface(double edge)`
Gets surface for a square

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getRectangleSurface

```public static double getRectangleSurface(double shortEdge,
double longEdge)```
Gets surface for a rectangle

Parameters:
`shortEdge` - DOCUMENT ME!
`longEdge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getParallelogramSurface

```public static double getParallelogramSurface(double base,
double height)```
Gets surface for a parallelogram

Parameters:
`base` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getTrapezoidSurface

```public static double getTrapezoidSurface(double longEdge,
double shortEdge,
double height)```
Gets surface for a trapezoid

Parameters:
`longEdge` - DOCUMENT ME!
`shortEdge` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getTriangleSurface

```public static double getTriangleSurface(double base,
double height)```
Gets surface for a triangle

Parameters:
`base` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCircleSurface

`public static double getCircleSurface(double radius)`
Gets surface for a circle

Parameters:
`radius` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getEllipseSurface

```public static double getEllipseSurface(double shortRadius,
Gets surface for a ellipse

Parameters:
`shortRadius` - DOCUMENT ME!
`longRadius` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCubeSurface

`public static double getCubeSurface(double edge)`
Gets volume for a cube

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCubeVolume

`public static double getCubeVolume(double edge)`
Gets volume for a cube

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getRectangularPrismSurface

```public static double getRectangularPrismSurface(double edge1,
double edge2,
double edge3)```
Gets surface for a rectangular prism

Parameters:
`edge1` - DOCUMENT ME!
`edge2` - DOCUMENT ME!
`edge3` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getRectangularPrismVolume

```public static double getRectangularPrismVolume(double edge1,
double edge2,
double edge3)```
Gets volume for a rectangular prism

Parameters:
`edge1` - DOCUMENT ME!
`edge2` - DOCUMENT ME!
`edge3` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCylinderSurface

```public static double getCylinderSurface(double radius,
double height)```
Gets surface for a cylinder

Parameters:
`radius` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getCylinderVolume

```public static double getCylinderVolume(double radius,
double height)```
Gets volume for a cylinder

Parameters:
`radius` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getConeSurface

```public static double getConeSurface(double radius,
double height)```
Gets surface for a cone

Parameters:
`radius` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getConeVolume

```public static double getConeVolume(double radius,
double height)```
Gets volume for a cone

Parameters:
`radius` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getSphereSurface

`public static double getSphereSurface(double radius)`
Gets surface for a sphere

Parameters:
`radius` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getSphereVolume

`public static double getSphereVolume(double radius)`
Gets volume for a sphere

Parameters:
`radius` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getEllipsoidVolume

```public static double getEllipsoidVolume(double radius1,
Gets volume for an ellipsoid

Parameters:
`radius1` - DOCUMENT ME!
`radius2` - DOCUMENT ME!
`radius3` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getPyramidSurface

```public static double getPyramidSurface(double base,
double height)```
Gets surface for a pyramid

Parameters:
`base` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getPyramidVolume

```public static double getPyramidVolume(double base,
double height)```
Gets volume for a pyramid

Parameters:
`base` - DOCUMENT ME!
`height` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getTetrahedronSurface

`public static double getTetrahedronSurface(double edge)`
Gets surface for a regular tetrahedron

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!

### getTetrahedronVolume

`public static double getTetrahedronVolume(double edge)`
Gets volume for a regular tetrahedron

Parameters:
`edge` - DOCUMENT ME!
Returns:
DOCUMENT ME!