14
14
15
15
/*
16
16
Calculate the volume for a Cuboid
17
+ Reference: https://www.cuemath.com/measurement/volume-of-cuboid/
17
18
return width * length * height
18
19
*/
19
20
const volCuboid = ( width , length , height ) => {
@@ -25,6 +26,7 @@ const volCuboid = (width, length, height) => {
25
26
26
27
/*
27
28
Calculate the volume for a Cube
29
+ Reference: https://www.cuemath.com/measurement/volume-of-cube/
28
30
return length * length * length
29
31
*/
30
32
const volCube = ( length ) => {
@@ -34,6 +36,7 @@ const volCube = (length) => {
34
36
35
37
/*
36
38
Calculate the volume for a Cone
39
+ Reference: https://www.cuemath.com/measurement/volume-of-cone/
37
40
return PI * radius^2 * height/3
38
41
*/
39
42
const volCone = ( radius , height ) => {
@@ -44,6 +47,7 @@ const volCone = (radius, height) => {
44
47
45
48
/*
46
49
Calculate the volume for a Pyramid
50
+ Reference: https://www.cuemath.com/measurement/volume-of-pyramid/
47
51
return (baseLength * baseWidth * height) / 3
48
52
*/
49
53
const volPyramid = ( baseLength , baseWidth , height ) => {
@@ -55,6 +59,7 @@ const volPyramid = (baseLength, baseWidth, height) => {
55
59
56
60
/*
57
61
Calculate the volume for a Cylinder
62
+ Reference: https://www.cuemath.com/measurement/volume-of-cylinder/
58
63
return PI * radius^2 * height
59
64
*/
60
65
const volCylinder = ( radius , height ) => {
@@ -65,6 +70,7 @@ const volCylinder = (radius, height) => {
65
70
66
71
/*
67
72
Calculate the volume for a Triangular Prism
73
+ Reference: http://lrd.kangan.edu.au/numbers/content/03_volume/04_page.htm
68
74
return 1 / 2 * baseLengthTriangle * heightTriangle * height
69
75
*/
70
76
const volTriangularPrism = ( baseLengthTriangle , heightTriangle , height ) => {
@@ -76,6 +82,7 @@ const volTriangularPrism = (baseLengthTriangle, heightTriangle, height) => {
76
82
77
83
/*
78
84
Calculate the volume for a Pentagonal Prism
85
+ Reference: https://www.cuemath.com/measurement/volume-of-pentagonal-prism/
79
86
return 5/2 * pentagonalLength * pentagonalBaseLength * height
80
87
*/
81
88
const volPentagonalPrism = ( pentagonalLength , pentagonalBaseLength , height ) => {
@@ -87,6 +94,7 @@ const volPentagonalPrism = (pentagonalLength, pentagonalBaseLength, height) => {
87
94
88
95
/*
89
96
Calculate the volume for a Sphere
97
+ Reference: https://www.cuemath.com/measurement/volume-of-sphere/
90
98
return 4/3 * PI * radius^3
91
99
*/
92
100
const volSphere = ( radius ) => {
@@ -96,6 +104,7 @@ const volSphere = (radius) => {
96
104
97
105
/*
98
106
Calculate the volume for a Hemisphere
107
+ Reference: https://www.cuemath.com/measurement/volume-of-hemisphere/
99
108
return (2 * PI * radius^3)/3
100
109
*/
101
110
const volHemisphere = ( radius ) => {
0 commit comments