Skip to content

Commit f2aad7b

Browse files
authored
Update on Volume.js formatting error
1 parent f52637f commit f2aad7b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

Maths/Volume.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
Calculate the volume of the shapes
3-
4-
Volume for Cuboid
5-
Volume for Cube
6-
Volume for Cone
7-
Volume for Pyramid
8-
Volume for Cylinder
9-
Volume for Triangular Prism
10-
Volume for Pentagonal Prism
11-
Volume for Sphere
12-
Volume for Hemisphere
13-
*/
2+
Calculate the volume of the shapes
3+
4+
Volume for Cuboid
5+
Volume for Cube
6+
Volume for Cone
7+
Volume for Pyramid
8+
Volume for Cylinder
9+
Volume for Triangular Prism
10+
Volume for Pentagonal Prism
11+
Volume for Sphere
12+
Volume for Hemisphere
13+
*/
1414

1515
/*
1616
Calculate the volume for a Cuboid
@@ -42,7 +42,7 @@ const volCube = (length) => {
4242
const volCone = (radius, height) => {
4343
isNumber(radius, 'Radius')
4444
isNumber(height, 'Height')
45-
return (Math.PI * radius ** 2 * height/3.0)
45+
return (Math.PI * radius ** 2 * height / 3.0)
4646
}
4747

4848
/*
@@ -54,7 +54,7 @@ const volPyramid = (baseLength, baseWidth, height) => {
5454
isNumber(baseLength, 'BaseLength')
5555
isNumber(baseWidth, 'BaseWidth')
5656
isNumber(height, 'Height')
57-
return (baseLength * baseWidth * height) / 3.0
57+
return (baseLength * baseWidth * height) / 3.0
5858
}
5959

6060
/*
@@ -71,7 +71,7 @@ const volCylinder = (radius, height) => {
7171
/*
7272
Calculate the volume for a Triangular Prism
7373
Reference: http://lrd.kangan.edu.au/numbers/content/03_volume/04_page.htm
74-
return 1 / 2 * baseLengthTriangle * heightTriangle * height
74+
return 1 / 2 * baseLengthTriangle * heightTriangle * height
7575
*/
7676
const volTriangularPrism = (baseLengthTriangle, heightTriangle, height) => {
7777
isNumber(baseLengthTriangle, 'BaseLengthTriangle')
@@ -89,7 +89,7 @@ const volPentagonalPrism = (pentagonalLength, pentagonalBaseLength, height) => {
8989
isNumber(pentagonalLength, 'PentagonalLength')
9090
isNumber(pentagonalBaseLength, 'PentagonalBaseLength')
9191
isNumber(height, 'Height')
92-
return (5/2 * pentagonalLength * pentagonalBaseLength * height)
92+
return (5 / 2 * pentagonalLength * pentagonalBaseLength * height)
9393
}
9494

9595
/*
@@ -99,7 +99,7 @@ const volPentagonalPrism = (pentagonalLength, pentagonalBaseLength, height) => {
9999
*/
100100
const volSphere = (radius) => {
101101
isNumber(radius, 'Radius')
102-
return (4/3 * Math.PI * radius ** 3)
102+
return (4 / 3 * Math.PI * radius ** 3)
103103
}
104104

105105
/*
@@ -109,7 +109,7 @@ const volSphere = (radius) => {
109109
*/
110110
const volHemisphere = (radius) => {
111111
isNumber(radius, 'Radius')
112-
return (2.0 * Math.PI * radius ** 3)/ 3.0
112+
return (2.0 * Math.PI * radius ** 3) / 3.0
113113
}
114114

115115
const isNumber = (number, noName = 'number') => {
@@ -120,4 +120,4 @@ const isNumber = (number, noName = 'number') => {
120120
}
121121
}
122122

123-
export {volCuboid, volCube, volCone, volPyramid, volCylinder, volTriangularPrism, volPentagonalPrism, volSphere, volHemisphere }
123+
export { volCuboid, volCube, volCone, volPyramid, volCylinder, volTriangularPrism, volPentagonalPrism, volSphere, volHemisphere }

0 commit comments

Comments
 (0)