مكتبة شاملة لحساب المساحة والمحيط للأشكال الثنائية والثلاثية الأبعاد
Project description
=====================================================
استخدام كامل لكل دوال مكتبة geometry_zyrenk
=====================================================
استيراد كل الفئات من shapes2d و shapes3d
from geometry_zyrenk import ( Square, Rectangle, Circle, Triangle, IsoscelesTriangle, EquilateralTriangle, Parallelogram, Rhombus, Trapezoid, RegularPolygon, Cube, RectangularPrism, Cylinder, Cone, Sphere, Pyramid, Prism )
=====================================================
الأشكال الثنائية الأبعاد (2D)
=====================================================
print("=== الأشكال الثنائية الأبعاد ===\n")
1️⃣ مربع
side = 5 print("مربع بطول ضلع =", side) print("مساحة:", Square.area(side)) # side^2 print("محيط:", Square.perimeter(side)) # 4*side print()
2️⃣ مستطيل
length, width = 6, 3 print("مستطيل طول={} عرض={}".format(length, width)) print("مساحة:", Rectangle.area(length, width)) # lengthwidth print("محيط:", Rectangle.perimeter(length, width)) # 2(length+width) print()
3️⃣ دائرة
radius = 4 print("دائرة نصف قطرها =", radius) print("مساحة:", Circle.area(radius)) # πr^2 print("محيط:", Circle.perimeter(radius)) # 2π*r print()
4️⃣ مثلث عام
base, height = 3, 4 a, b, c = 3, 4, 5 print("مثلث عام base={} height={}".format(base, height)) print("مساحة:", Triangle.area(base, height)) # 0.5baseheight print("محيط:", Triangle.perimeter(a, b, c)) # a+b+c print()
5️⃣ مثلث متساوي الساقين
equal_side, base = 5, 6 print("مثلث متساوي الساقين equal_side={} base={}".format(equal_side, base)) print("محيط:", IsoscelesTriangle.perimeter(equal_side, base)) # 2*equal_side + base print()
6️⃣ مثلث متساوي الأضلاع
side = 4 print("مثلث متساوي الأضلاع side={}".format(side)) print("محيط:", EquilateralTriangle.perimeter(side)) # 3*side print()
7️⃣ متوازي أضلاع
base, side, height = 6, 3, 4 print("متوازي أضلاع base={} side={} height={}".format(base, side, height)) print("مساحة:", Parallelogram.area(base, height)) # baseheight print("محيط:", Parallelogram.perimeter(base, side)) # 2(base+side) print()
8️⃣ معين
d1, d2, side = 5, 6, 4 print("معين diagonals={}{} side={}".format(d1, d2, side)) print("مساحة:", Rhombus.area(d1, d2)) # 0.5d1d2 print("محيط:", Rhombus.perimeter(side)) # 4*side print()
9️⃣ شبه منحرف
a, b, c, d, height = 6, 4, 3, 3, 5 print("شبه منحرف a={} b={} c={} d={} height={}".format(a,b,c,d,height)) print("مساحة:", Trapezoid.area(a,b,height)) # 0.5*(a+b)*height print("محيط:", Trapezoid.perimeter(a,b,c,d)) # a+b+c+d print()
10️⃣ مضلع منتظم (مثلاً خماسي)
side, n = 3, 5 print("مضلع منتظم عدد الأضلاع={} طول ضلع={}".format(n,side)) print("مساحة:", RegularPolygon.area(side,n)) # (nside^2)/(4tan(pi/n)) print("محيط:", RegularPolygon.perimeter(side,n)) # n*side print()
=====================================================
الأشكال الثلاثية الأبعاد (3D)
=====================================================
print("=== الأشكال الثلاثية الأبعاد ===\n")
1️⃣ مكعب
side = 3 print("مكعب طول ضلع={}".format(side)) print("حجم:", Cube.volume(side)) # side^3 print("مساحة سطح:", Cube.surface_area(side)) # 6*side^2 print()
2️⃣ متوازي مستطيلات
l, w, h = 4, 3, 5 print("متوازي مستطيلات l={} w={} h={}".format(l,w,h)) print("حجم:", RectangularPrism.volume(l,w,h)) # lwh print("مساحة سطح:", RectangularPrism.surface_area(l,w,h)) # 2*(lw+lh+wh) print()
3️⃣ اسطوانة
radius, height = 3, 7 print("اسطوانة radius={} height={}".format(radius,height)) print("حجم:", Cylinder.volume(radius,height)) # πr^2h print("مساحة سطح:", Cylinder.surface_area(radius,height)) # 2πr(r+h) print()
4️⃣ مخروط
radius, height = 3, 5 print("مخروط radius={} height={}".format(radius,height)) print("حجم:", Cone.volume(radius,height)) # (1/3)πr^2h print("مساحة سطح:", Cone.surface_area(radius,height)) # πr*(r+l) print()
5️⃣ كرة
radius = 4 print("كرة radius={}".format(radius)) print("حجم:", Sphere.volume(radius)) # 4/3πr^3 print("مساحة سطح:", Sphere.surface_area(radius)) # 4πr^2 print()
6️⃣ هرم
base_area, perimeter_base, slant_height, height = 16, 16, 5, 6 print("هرم base_area={} perimeter_base={} slant_height={} height={}".format(base_area, perimeter_base, slant_height, height)) print("حجم:", Pyramid.volume(base_area,height)) # (1/3)base_areaheight print("مساحة سطح:", Pyramid.surface_area(base_area, perimeter_base, slant_height)) # base_area + 0.5perimeter_baseslant_height print()
7️⃣ منشور
base_area, perimeter_base, height = 10, 14, 6 print("منشور base_area={} perimeter_base={} height={}".format(base_area, perimeter_base, height)) print("حجم:", Prism.volume(base_area,height)) # base_areaheight print("مساحة سطح:", Prism.surface_area(base_area, perimeter_base, height)) # 2base_area + perimeter_base*height print()
print("✅ تم استخدام كل الدوال والفئات حرفيًا في المكتبة وطباعة النتائج بنجاح.")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geometry_zyrenk-1.0.0.tar.gz.
File metadata
- Download URL: geometry_zyrenk-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cbb9f553222b4f90e4b04d050b5a96fe8791b8a370c7854b679bf5df4bb54f4
|
|
| MD5 |
bc7d0b3013fc22b551f60e9b4995acfc
|
|
| BLAKE2b-256 |
0543edd2a70219b89ab2940b3bc7587756c5678830cd3668a8169a639bf4c14e
|
File details
Details for the file geometry_zyrenk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: geometry_zyrenk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
537d0797c38cea3ed9d6c5c65fff6588794176fad92d88a15614ade1f379444d
|
|
| MD5 |
f1d4ee69b5e76719383329494f90c389
|
|
| BLAKE2b-256 |
ee324a5768629c484ff05460a7937ba9d2fcf655b4185563f0922840b45c944e
|