MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / volSphere

Function volSphere

Maths/Volume.js:100–103  ·  view source on GitHub ↗
(radius)

Source from the content-addressed store, hash-verified

98 return 4/3 * PI * radius^3
99*/
100const volSphere = (radius) => {
101 isNumber(radius, 'Radius')
102 return (4 / 3) * Math.PI * radius ** 3
103}
104
105/*
106 Calculate the volume for a Hemisphere

Callers

nothing calls this directly

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected