absfuyu.general.shape module
Absfuyu: Shape
Shapes
Version: 5.1.0 Date updated: 10/03/2025 (dd/mm/yyyy)
- class absfuyu.general.shape.Triangle(a: int | float, b: int | float, c: int | float)[source]
Bases:
Polygon- is_right_angled() bool[source]
Checks if the triangle is a right-angled triangle (one vertex has degree of 90) using the Pythagorean theorem.
- Returns:
Trueif the triangle is right-angled,Falseotherwise.- Return type:
bool
- is_equilateral() bool[source]
Checks if the triangle is an equilateral triangle (3 sides have the same length).
- Returns:
Trueif the triangle is equilateral,Falseotherwise.- Return type:
bool
- is_isosceles() bool[source]
Checks if the triangle is an isosceles triangle (at least two sides are equal).
- Returns:
Trueif the triangle is isosceles,Falseotherwise.- Return type:
bool
- triangle_type() str[source]
Determines the type of triangle based on its sides.
- Returns:
A string describing the type of triangle:
"equilateral","isosceles","right-angled", or"scalene"if none of the other types apply.- Return type:
str
- is_acute() bool[source]
Checks if the triangle is an acute triangle (all angles less than 90 degrees).
- Returns:
Trueif the triangle is acute,Falseotherwise.- Return type:
bool
- is_obtuse() bool[source]
Checks if the triangle is an obtuse triangle (one angle greater than 90 degrees).
- Returns:
Trueif the triangle is obtuse,Falseotherwise.- Return type:
bool
- get_angles() tuple[float, float, float][source]
Calculates and returns the angles of the triangle in degrees.
- Returns:
A tuple containing the angles in degrees (angle_A, angle_B, angle_C).
- Return type:
tuple[float, float, float]
- scale(factor: int | float) None[source]
Scales the triangle by a given factor, changing the lengths of all sides.
- Parameters:
factor (int | float) – The scaling factor. Must be positive.
- Raises:
ValueError – If the scaling factor is not positive.
- class absfuyu.general.shape.Circle(radius: int | float)[source]
Bases:
Polygon- scale(factor: int | float) None[source]
Scales the circle by a given factor, changing its radius.
- Parameters:
factor (int | float) – The scaling factor. Must be positive.
- Raises:
ValueError – If the scaling factor is not positive.
- class absfuyu.general.shape.Square(side: int | float)[source]
Bases:
EqualSidesPolygon
- class absfuyu.general.shape.Rectangle(length: int | float, width: int | float)[source]
Bases:
Polygon
- class absfuyu.general.shape.Pentagon(side: int | float)[source]
Bases:
EqualSidesPolygon
- class absfuyu.general.shape.Hexagon(side: int | float)[source]
Bases:
EqualSidesPolygon
- class absfuyu.general.shape.Parallelogram(base: int | float, height: int | float, *, a: int | float | None = None, phi: int | float | None = None)[source]
Bases:
Polygon
- class absfuyu.general.shape.Trapezoid(a: int | float, b: int | float, c: int | float | None = None, d: int | float | None = None, h: int | float | None = None)[source]
Bases:
Polygon
- class absfuyu.general.shape.Cube(side: int | float)[source]
Bases:
ThreeDimensionShape- surface_area_side() int | float[source]
Calculates and returns the surface area (side only) of the cube.
- class absfuyu.general.shape.Cuboid(length: int | float, width: int | float, height: int | float)[source]
Bases:
ThreeDimensionShape
- class absfuyu.general.shape.Sphere(radius: int | float)[source]
Bases:
ThreeDimensionShape
- class absfuyu.general.shape.HemiSphere(radius: int | float)[source]
Bases:
ThreeDimensionShape- surface_area_curved() float[source]
Calculates and returns the curved surface area of the hemisphere.
- surface_area_base() float[source]
Calculates and returns the area of the base (circular) of the hemisphere.