Skip to content

Documentation for volume.py

TheTechRobo edited this page May 23, 2021 · 7 revisions

This article will be made outdated by the rewrite. You can help Palc by editing it.

I suggest if you aren't developing a program using Mathmod, just boot up Palc and use the interactive mode. It's much better than what you're trying to do here.

DISCLAIMER: This calculator is not perfect. So don't stop using the project JUST BECAUSE it was off by 0.1 or something. Also, you can't sue us or anything. See LICENSE for more details.

Cube

Syntax: vol_cube(a)
Takes a as the side of the cube. Returns the volume.

Cuboid

Syntax: vol_cuboid(l, b, h)
Takes l,b, and h as length, breadth, and height, respectively. Returns the volume.

Cylinder

Syntax: vol_cylinder(r, h)
Takes r and h as radius and height, respectively. Returns the volume.

Hollow cylinder

Syntax: vol_hollow_cylinder(ro, rs, h)
Takes ro, rs, and h as radius of the hollow space, radius of the cylinder, and height of the cylinder, respectively. Returns the volume.

Cone

Syntax: vol_cone(r, h)
Takes r and h as the radius and height of the cone, respectively. Returns the volume.

Sphere

Syntax: vol_sphere(r)
Takes r as the radius of the sphere. Returns the volume.

Hollow sphere

Syntax: vol_hollow_sphere(ro, rs)
Takes ro and rs as the full radius of the sphere, and radius of the hollow space of the sphere, respectively. Returns the volume.

Triangular prism

Syntax: vol_tri_prism(a, h)
Takes a and h as the legnth of the side of the triangular base, and height of the prism, respectively. Returns the volume.

Pentagonal prism

Syntax: vol_penta_prism(a, h)
Takes a and h as the length of the side of the pentagon base, and height of the prism, respectively. Returns the volume.

Hexagonal prism

Syntax: vol_hexa_prism(a, h)
Takes a and h as the length of the side of the hexagon, and height of the prism, respectively. Returns the volume.

Square-based pyramid

Syntax: vol_sqr_pyramid(a, h)
Takes a and h as the length of the side of the square base, and height of the pyramid, respectively. Returns the volume.

Triangle-based pyramid

Syntax: vol_tri_pyramid(a, h)
Takes a and h as the length of the side of the triangle base, and height of the pyramid, respectively. Returns the volume.

Pentagon-based pyramid

Syntax: vol_penta_pyramid(a, h)
Takes a and h as the length of the side of the pentagon base, and height of the pyramid, respectively. Returns the volume.

Hexagon-based pyramid

Syntax: vol_hexa_pyramid(a, h)
Takes a and h as the length of the side of the hexagon base, and height of the pyramid, respectively. Returns the volume.

Clone this wiki locally