- Main Page
- Classes
- Files

- File List

# C:/Users/Andreas Schiffler/Desktop/SVN/NewGamePhysics/NewGamePhysics/Mathematics/Volume.cs

    00001 ﻿//-----------------------------------------------------------------------------
    00002 // Volume.cs
    00003 // (A. Schiffler, 2009)
    00004 //-----------------------------------------------------------------------------
    00005
    00006 namespace NewGamePhysics.Mathematics
    00007 {
    00008     using System;
    00009     using System.Collections.Generic;
    00010     using System.Linq;
    00011     using System.Text;
    00012
    00016     public static class Volume
    00017     {
    00023         public static double Cube(double length)
    00024         {
    00025             return length * length * length;
    00026         }
    00027
    00033         public static double Sphere(double radius)
    00034         {
    00035             return (4.0 / 3.0) * Math.PI * radius * radius * radius;
    00036         }
    00037
    00044         public static double Cone(double radius, double height)
    00045         {
    00046             return (1.0 / 3.0) * Math.PI * radius * radius * height;
    00047         }
    00048
    00055         public static double Cylinder(double radius, double height)
    00056         {
    00057             return Math.PI * radius * radius * height;
    00058         }
    00059
    00066         public static double Prism(double area, double height)
    00067         {
    00068             return area * height;
    00069         }
    00070
    00077         public static double Pyramid(double area, double height)
    00078         {
    00079             return (1.0 / 3.0) * area * height;
    00080         }
    00081     }
    00082 }