|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Implmentations for the volume of various 3D shapes. More...
#include <cassert>#include <cmath>#include <cstdint>#include <iostream>Namespaces | |
| namespace | math |
| for std::rand | |
Functions | |
| template<typename T > | |
| T | math::cube_volume (T length) |
| The volume of a cube More... | |
| template<typename T > | |
| T | math::rect_prism_volume (T length, T width, T height) |
| The volume of a rectangular prism. More... | |
| template<typename T > | |
| T | math::cone_volume (T radius, T height, double PI=3.14) |
| The volume of a cone More... | |
| template<typename T > | |
| T | math::triangle_prism_volume (T base, T height, T depth) |
| The volume of a triangular prism. More... | |
| template<typename T > | |
| T | math::pyramid_volume (T length, T width, T height) |
| The volume of a pyramid More... | |
| template<typename T > | |
| T | math::sphere_volume (T radius, double PI=3.14) |
| The volume of a sphere More... | |
| template<typename T > | |
| T | math::cylinder_volume (T radius, T height, double PI=3.14) |
| The volume of a cylinder More... | |
| static void | test () |
| Self-test implementations. More... | |
| int | main () |
| Main function. More... | |
Implmentations for the volume of various 3D shapes.
The volume of a 3D shape is the amount of 3D space that the shape takes up. All shapes have a formula to get the volume of any given shape. These implementations support multiple return types.
| int main | ( | void | ) |
|
static |
Self-test implementations.