A tube is 100 cm long, 10 cm in diameter, with a wall thickness of 1 cm. What is its area?
areaHollowCyl(10;1;100)=5711.415445
The next function is for the area of a cone or truncated cone. This function can calculate both regular cone, and truncated cone. If the cone is regular, enter 0 as the top diameter.
areaCone(x; y; z )
Where
x = bottom diameter
y = top diameter (=0)
z = height
The formula includes the bottom and top surfaces and the sloping outer surface. Use 0 for the top diameter of a pointed cone.
A truncated cone, with bottom diameter 10 cm, top diameter 8 cm, and 4 cm tick:
areaCone(10;8;4)=245.383364 cm2
The next function calculates the area of a pyramid with a square base.
areaPyramide(x; y )
Where
x = length of one side of square
y = height from center of base to top
Using the following formula:
xyresult:length of one side of square:height from center of base to top=2⋅x⋅(2x)2+y2+x2
Example:
A pyramid has a 10 × 10 cm square base and a height of 20 cm.
areaPyramide(10;20)=512.3105626 cm2
The next function is for the area of a triange (any combination of angles. Any sum of two sides must be longer than the third for being a triangle.
***areaTriangle(x; y; z ) ***
Where
x = length first side
y = length of second side
z = length of third side
Using Heron's formula:
xyzcresult:length first side:length of second side:length of third side=2x+y+z=c⋅(c−x)⋅(c−y)⋅(c−z)
Example:
areaTriangle(10;12;15)=59.81168364
The next function calculates the area of an ellipse:
areaEllipse(x; y )
Where
x = width
y = height
Using the following formula:
xyresult:width:height=4π⋅x⋅y
Example:
areaEllipse(15;20)=235.619449
*The next function is for calculating the area of a regular polygon. *
areaRegPolygon(x; y )
Where
x = number of sides
y = distance from center to one of its corners
The first formula calculates half of an interior angle. The polygon is then treated as x triangles whose top points meet at the center.
xyaresult:number of sides:distance from center to one of its corners=x90⋅(x−2)=x⋅cos(a)⋅sin(a)⋅y2
Example:
A pentagon with the length from the center to one angle, is 15 cm. What is the area:
areaRegPolygon(5;15)=534.9692903
The final area function is for a regular star polygon formed by extending the sides of an inner regular polygon until they intersect. A pentagram is one example. The function does not apply to every symmetrical star shape.
areaRegStarPolygon(x; y )
Where
x = number of sides
y = distance from center to one of its inner corners
Using the following formulas:
xyaresult:number of sides:distance from center to one of its inner corners=x90⋅(x−2)=x⋅tan(180−2⋅a)⋅y2⋅cos(a)2+x⋅sin(a)⋅y2⋅cos(a)
We calculate the triangles that extends from the inner polygon, and then the area of the inner polygon itself.