Skip to content

Commit 11efaec

Browse files
authored
Add files via upload
1 parent beacc51 commit 11efaec

File tree

1 file changed

+354
-0
lines changed

1 file changed

+354
-0
lines changed

Lib/src/Main_doc.ipynb

Lines changed: 354 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,354 @@
1+
{
2+
"nbformat":4,"nbformat_minor":0,"metadata": {
3+
"colab": {
4+
"provenance":[],"authorship_tag":"ABX9TyPyI4ifaisvv3glJSaxNVQW"
5+
},"kernelspec": {
6+
"name":"python3","display_name":"Python 3"
7+
},"language_info": {
8+
"name":"python"
9+
}},"cells":[{
10+
"cell_type": "markdown",
11+
"id": "y6yt6y7y",
12+
"metadata": {},
13+
"source": [
14+
"#Lib.main\n## New_Math \n",
15+
"\n ### Round \n",
16+
" **This function is for getting approximation** \n",
17+
"\nWhen decimal value of num is between \n",
18+
" 0.25-0.85, it will print as they are.\n"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": 1,
24+
"id": "h7y5yr67",
25+
"metadata": {},
26+
"outputs": [{
27+
"name": "stdout",
28+
"output_type": "stream",
29+
"text": [
30+
"7.4\n"
31+
]
32+
}],
33+
"source": [
34+
"from Lib.main import *\n",
35+
"num=7.4\n",
36+
"new_math.round(num)\n"
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"id": "e66ee7ek",
42+
"metadata": {},
43+
"source": [
44+
"\n",
45+
"If decimal value of number is lower than 0.25, it will print their floor value.\n"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": 2,
51+
"id": "h7y5yj67",
52+
"metadata": {},
53+
"outputs": [{
54+
"name": "stdout",
55+
"output_type": "stream",
56+
"text": [
57+
"2\n"
58+
]
59+
}],
60+
"source": [
61+
"from Lib.main import *\n",
62+
"num=2.1\n",
63+
"new_math.round(num)\n"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"id": "966eo7ek",
69+
"metadata": {},
70+
"source": [
71+
"\n",
72+
"If decimal value is greater than 0.85, it will print their ceiling value\n"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": 3,
78+
"id": "h5y5yr67",
79+
"metadata": {},
80+
"outputs": [{
81+
"name": "stdout",
82+
"output_type": "stream",
83+
"text": [
84+
"7\n"
85+
]
86+
}],
87+
"source": [
88+
"from Lib.main import *\n",
89+
"num=6.87\n",
90+
"new_math.round(num)\n"
91+
]
92+
},
93+
{
94+
"cell_type": "markdown",
95+
"id": "e6qee7ek",
96+
"metadata": {},
97+
"source": [
98+
"### Cbrt \n",
99+
" **This function is for getting Cuberoot of given number**\n"
100+
]
101+
},
102+
{
103+
"cell_type": "code",
104+
"execution_count": 4,
105+
"id": "h7y5yr65",
106+
"metadata": {},
107+
"outputs": [{
108+
"name": "stdout",
109+
"output_type": "stream",
110+
"text": [
111+
"12\n"
112+
]
113+
}],
114+
"source": [
115+
"from Lib.main import *\n",
116+
"new_math.cbrt(1728)\n"
117+
]
118+
},
119+
{
120+
"cell_type": "markdown",
121+
"id": "e66we7ek",
122+
"metadata": {},
123+
"source": [
124+
"### Logadd \n",
125+
" **This function is for getting addition of log values** \n"
126+
]
127+
},
128+
{
129+
"cell_type": "code",
130+
"execution_count": 5,
131+
"id": "h9y5yr67",
132+
"metadata": {},
133+
"outputs": [{
134+
"name": "stdout",
135+
"output_type": "stream",
136+
"text": [
137+
"0.7781\n"
138+
]
139+
}],
140+
"source": [
141+
"from Lib.main import *\n",
142+
"new_math.logadd(2,3)\n"
143+
]
144+
},
145+
{
146+
"cell_type": "markdown",
147+
"id": "e66ep7ek",
148+
"metadata": {},
149+
"source": [
150+
"### Logsub \n",
151+
" **This function is for getting subtraction of log values** \n"
152+
]
153+
},
154+
{
155+
"cell_type": "code",
156+
"execution_count": 6,
157+
"id": "c7y5yr67",
158+
"metadata": {},
159+
"outputs": [{
160+
"name": "stdout",
161+
"output_type": "stream",
162+
"text": [
163+
"0.6989\n"
164+
]
165+
}],
166+
"source": [
167+
"from Lib.main import *\n",
168+
"new_math.logsub(10,2)\n"
169+
]
170+
},
171+
{
172+
"cell_type": "markdown",
173+
"id": "e6h7e7ek",
174+
"metadata": {},
175+
"source": [
176+
" ### About New_Math \n",
177+
"**It is an attribute of Lib.main, it made for fulfillment of requirements, programmers require in math module** \n",
178+
"\n",
179+
" ## Matrix \n\n",
180+
"**This function is for getting matrix form of a list, tuple, or sets**\n\n"
181+
]
182+
},
183+
{
184+
"cell_type": "code",
185+
"execution_count": 7,
186+
"id": "h7y5ar67",
187+
"metadata": {},
188+
"outputs": [{
189+
"name": "stdout",
190+
"output_type": "stream",
191+
"text": [
192+
"2 5 7\n",
193+
"3 2 6\n",
194+
"4 7 2\n"
195+
]
196+
}],
197+
"source": [
198+
"from Lib.main import *\n",
199+
"matrix.matrix([[2,5,7],[3,2,6],[4,7,2]])\n"
200+
]
201+
},
202+
{
203+
"cell_type": "markdown",
204+
"id": "f66e9hek",
205+
"metadata": {},
206+
"source": [
207+
" ### Mat_trans \n",
208+
" **This function is for getting transpose of matrix form of list, tuple or set** \n"
209+
]
210+
},
211+
{
212+
"cell_type": "code",
213+
"execution_count": 8,
214+
"id": "h7j5yr67",
215+
"metadata": {},
216+
"outputs": [{
217+
"name": "stdout",
218+
"output_type": "stream",
219+
"text": [
220+
"2 3 4\n",
221+
"5 2 7\n",
222+
"7 6 2\n"
223+
]
224+
}],
225+
"source": [
226+
"from Lib.main import *\n",
227+
" \n",
228+
"matrix.mat_trans([[2,5,7],[3,2,6],[4,7,2]])\n"
229+
]
230+
},
231+
{
232+
"cell_type": "markdown",
233+
"id": "e66ed6ek",
234+
"metadata": {},
235+
"source": [
236+
" ### determin \n",
237+
" **This function is for getting determinant of a matrix form of list, tuple or set** \n"
238+
]
239+
},
240+
{
241+
"cell_type": "code",
242+
"execution_count": 9,
243+
"id": "a7y5yr67",
244+
"metadata": {},
245+
"outputs": [{
246+
"name": "stdout",
247+
"output_type": "stream",
248+
"text": [
249+
"105\n"
250+
]
251+
}],
252+
"source": [
253+
"from Lib.main import *\n",
254+
"matrix.determin([[2,5,7],[3,2,6],[4,7,2]])\n"
255+
]
256+
},
257+
{
258+
"cell_type": "markdown",
259+
"id": "e66y67ek",
260+
"metadata": {},
261+
"source": [
262+
" ### About Matrix \n",
263+
" **Matrix is an attribute of Lib.main, it is for making matrix, transpose of matrix and determinant of list, tuple or set** \n",
264+
"\n",
265+
" ## Notation \n",
266+
"\n",
267+
" ### Prefix \n",
268+
" **This function is for getting solution of a given Prefix format question, question should be given in string data type** \n"
269+
]
270+
},
271+
{
272+
"cell_type": "code",
273+
"execution_count": 10,
274+
"id": "h7y3yr67",
275+
"metadata": {},
276+
"outputs": [{
277+
"name": "stdout",
278+
"output_type": "stream",
279+
"text": [
280+
"7\n",
281+
"3\n"
282+
]
283+
}],
284+
"source": [
285+
"from Lib.main import *\n",
286+
"notation.prefix('+25')\n",
287+
"notation.prefix('/93')\n"
288+
]
289+
},
290+
{
291+
"cell_type": "markdown",
292+
"id": "e6h8e7ek",
293+
"metadata": {},
294+
"source": [
295+
" ### Postfix \n",
296+
" **This function is for getting solution of a given Postfix format question, question should b given in string data type**\n"
297+
]
298+
},
299+
{
300+
"cell_type": "code",
301+
"execution_count": 11,
302+
"id": "j7y5yr67",
303+
"metadata": {},
304+
"outputs": [{
305+
"name": "stdout",
306+
"output_type": "stream",
307+
"text": [
308+
"2\n",
309+
"6\n"
310+
]
311+
}],
312+
"source": [
313+
"from Lib.main import *\n",
314+
"notation.postfix('97-')\n",
315+
"notation.postfix('23*')\n"
316+
]
317+
},
318+
{
319+
"cell_type": "markdown",
320+
"id": "e69ic7ek",
321+
"metadata": {},
322+
"source": [
323+
" ### About Notation \n",
324+
" **Notation is an attribute of Lib.main, it is made for getting solution of questions given in Prefix or Postfix equations\n\n"
325+
]
326+
},
327+
{
328+
"cell_type":"markdown","source":["# Lib.shapes \n","\n","## Cuboid"],"metadata": {
329+
"id":"j8IWK_wxeuzP"
330+
}}, {
331+
"cell_type":"code","execution_count":null,"metadata": {
332+
"id":"D-0LInRhZQyB"
333+
},"outputs":[],"source":["import math \n","class Cuboid:\n"," def __init__(self, length: float, brea: float, hei: float):\n"," self.length = len;\n"," self.brea= brea\n"," self.hei = hei;\n"," def TotalSurfaceArea(self):\n"," return 2*(self.length*self.brea + self.brea*self.hei + self.length*self.hei); \n"," def LateralSurfaceArea(self):\n"," return 2*(self.length + self.brea)* self.hei;\n"," def Volume(self):\n"," return self.length * self.hei * self.brea;\n"," def lengthofDiagonal(self):\n"," return math.sqrt(math.pow(self.length, 2) + math.pow(self.brea, 2) + math.pow(self.hei, 2));\n"," def execution(self):\n"," print(f\"Total Surface area: {self.TotalSurfaceArea()}\")\n"," print(f\"Lateral Surface area: {self.LateralSurfaceArea()}\")\n"," print(f\"Volume: {self.Volume()}\")\n"," print(f\"Length of Diagonal: {self.lengthofDiagonal()}\")"]}, {
334+
"cell_type":"markdown","source":["**It has a constructor**\n","\n","**It is used to get Total Surface area, Lateral Surface area, Volume, length of Diagonal and a execution method**\n","\n","### __init__\n","\n","It takes length, breadth and height of Cuboid \n","```python \n","from Lib.shapes import *;\n","len: float = 9;\n","brea: float= 8;\n","hei: float = 7;\n","cuboid: Cuboid = Cuboid(len, brea, hei);\n","```\n","\n","### TotalSurfaceArea\n","\n","it returns Total Surface area of Cuboid which is \n","\n","$2×(l×b + l×h + h×b)$\n","\n","```python\n","print(cuboid.TotalSurfaceArea())\n","```\n","`382`\n","\n","### LateralSurfaceArea\n","\n","it returns Lateral Surface area of Cuboid which is $2×(l + b)× h$\n","\n","```python\n","print(cuboid.LateralSurfaceArea())\n","```\n","`238`\n","\n","### Volume \n","\n","it returns Volume of Cuboid which is $l×b×h\\$\n","\n","```python\n","print(cuboid.Volume())\n","```\n","`504`\n","\n","### lengthofDiagonal\n","\n","it return length of Diagonal of Cuboid which is $\\sqrt{l² + b² + h²}\\$\n","\n","```python\n","print(cuboid.lengthofDiagonal())\n","```\n","`13.92`\n","\n","### execution\n","\n","it prints the value returned by TotalSurfaceArea, LateralSurfaceArea, Volume, lengthofDiagonal \n","\n","```python\n","cuboid.execution()\n","```\n","```\n","Total Surface area: 382\n","Lateral Surface area: 238\n","Volume: 504\n","Length of Diagonal: 13.92\n","```\n","\n","## Cube"],"metadata": {
335+
"id":"60Wo-LZKavik"
336+
}}, {
337+
"cell_type":"code","source":["class Cube:\n"," def __init__(self, side: float):\n"," self.side = side;\n"," def TotalSurfaceArea(self):\n"," return 6* self.side * self.side; \n"," def LateralSurfaceArea(self):\n"," return 4* self.side* self.side;\n"," def Volume(self):\n"," return self.side * self.side * self.side;\n"," def lengthofDiagonal(self):\n"," return self.side* 1.73;\n"," def execution(self):\n"," print(f\"Total Surface area: {self.TotalSurfaceArea()}\")\n"," print(f\"Lateral Surface area: {self.LateralSurfaceArea()}\")\n"," print(f\"Volume: {self.Volume()}\")\n"," print(f\"Length of Diagonal: {self.lengthofDiagonal()}\")"],"metadata": {
338+
"id":"BRgiua2_a1s6"
339+
},"execution_count":null,"outputs":[]}, {
340+
"cell_type":"markdown","source":["**It has a constructor**\n","\n","**It is used to get Total Surface area, Lateral Surface area, Volume, length of Diagonal and a execution method**\n","\n","### __init__\n","\n","It takes side of Cube\n","\n","```python \n","from Lib.shapes import *;\n","side: float= 8;\n","cube: Cube = Cube(side);\n","```\n","\n","### TotalSurfaceArea\n","\n","it returns Total Surface area of Cube which is $6 × a²\\$\n","\n","```python\n","print(cube.TotalSurfaceArea())\n","```\n","\n","`384`\n","\n","### LateralSurfaceArea\n","\n","it returns Lateral Surface area of Cube which is $4 × a²\\$\n","\n","```python\n","print(cube.LateralSurfaceArea())\n","```\n","`256`\n","\n","### Volume \n","\n","it returns Volume of Cube which is $a³\\$\n","\n","```python\n","print(cube.Volume())\n","```\n","\n","`512`\n","\n","### lengthofDiagonal\n","\n","it return length of Diagonal of Cube which is $\\sqrt{3} × a$\n","\n","```python\n","print(cube.lengthofDiagonal())\n","```\n","`13.84`\n","\n","### execution\n","\n","it prints the value returned by TotalSurfaceArea, LateralSurfaceArea, Volume, lengthofDiagonal\n","```python\n","cube.execution()\n","```\n","```\n","Total Surface area: 384\n","Lateral Surface area: 256\n","Volume: 512\n","Length of Diagonal: 13.84\n","```\n","\n","## Sphere"],"metadata": {
341+
"id":"LgPtj0qQbHij"
342+
}}, {
343+
"cell_type":"code","source":["class Sphere:\n"," def __init__(self, radius: float):\n"," self.radius = radius;\n"," def SurfaceArea (self):\n"," return 4 * 3.14 * (self.radius**2);\n"," def Volume(self):\n"," return 1.67 * 3.14 * (self.radius**3);\n"," def execution(self):\n"," print(f\"Surface Area: {self.SurfaceArea()}\");\n"," print(f\"Volume: {self.Volume()}\");"],"metadata": {
344+
"id":"Bux1KM-sa7y2"
345+
},"execution_count":null,"outputs":[]}, {
346+
"cell_type":"markdown","source":["**It has a constructor**\n","\n","**It is used to get Surface area, Volume and a execution method**\n","\n","### __init__\n","\n","It takes radius of Sphere\n","\n","```python \n","from Lib.shapes import *;\n","radius: float= 7;\n","sphere: Sphere = Cube(side);\n","```\n","\n","### SurfaceArea\n","\n","it returns Surface area of Sphere which is\n","$4 × π × r²$\n","\n","```python\n","print(sphere.TotalSurfaceArea())\n","```\n","\n","`615.44`\n","\n","### Volume \n","\n","it returns Volume of Sphere which is $4/3 × π × r³\\$\n","\n","```python\n","print(sphere.Volume())\n","```\n","\n","`1798.6234`\n","\n","### execution\n","\n","it prints the value returned by SurfaceArea, Volume\n","```python\n","sphere.execution()\n","```\n","```\n","Surface area: 615.44\n","Volume: 1798.6234\n","```\n","\n","## Cylinder"],"metadata": {
347+
"id":"LonFIxH8bIly"
348+
}}, {
349+
"cell_type":"code","source":["class Cylinder:\n"," def __init__(self, radius: float, height: float):\n"," self.radius = radius;\n"," self.height = height;\n"," def TotalSurfaceArea(self):\n"," return 2* 3.14 * self.radius * (self.height + self.radius);\n"," def CurvedSurfaceArea(self):\n"," return 2* 3.14 * self.radius * self.height;\n"," def Volume(self):\n"," return 3.14 * (self.radius**2) * self.height;\n"," def execution(self):\n"," print(f\"Total Surface Area: {self.TotalSurfaceArea()}\");\n"," print(f\"Curved Surface Area: {self.CurvedSurfaceArea()}\");\n"," print(f\"Volume: {self.Volume()}\");"],"metadata": {
350+
"id":"knDPtanpa8ed"
351+
},"execution_count":null,"outputs":[]}, {
352+
"cell_type":"markdown","source":["**It has a constructor**\n","\n","**It is used to get Total Surface area, Curved Surface area, Volume and a execution method**\n","\n","### __init__\n","\n","It takes radius and height of Cylinder\n","\n","```python \n","from Lib.shapes import *;\n","radius: float= 7;\n","height: float= 3;\n","cylinder: Cylinder = Cylinder(radius, height);\n","```\n","\n","### TotalSurfaceArea\n","\n","it returns Total Surface area of Cylinder which is $2 × π × r × (h + r)$\n","\n","```python\n","print(cylinder.TotalSurfaceArea())\n","```\n","\n","`439.6`\n","\n","### CurvedSurfaceArea\n","\n","it returns Curved Surface area of Cylinder which is $2 × π × r × h\\$\n","\n","```python\n","print(cylinder.CurvedSurfaceArea())\n","```\n","`131.88`\n","\n","### Volume \n","\n","it returns Volume of Cylinder which is $π × r² × h\\$\n","\n","```python\n","print(cylinder.Volume())\n","```\n","\n","`461.58`\n","\n","### execution\n","\n","it prints the value returned by TotalSurfaceArea, CurvedSurfaceArea, Volume\n","```python\n","sphere.execution()\n","```\n","```\n","Total Surface area: 439.6\n","Curved Surface area: 131.88\n","Volume: 461.58\n","```"],"metadata": {
353+
"id":"BZ7Zq1XZbJ4H"
354+
}}]}

0 commit comments

Comments
 (0)