package-ta 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: package-ta
3
+ Version: 1.0.0
4
+ Summary: An awesome package that does something
5
+ Home-page: http://pypi.python.org/pypi/rocket-ta/
6
+ Author: rabia
7
+ Author-email: talebrabia620@gmail.com
8
+ License: LICENSE.txt
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.txt
11
+ Dynamic: author
12
+ Dynamic: author-email
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: license
17
+ Dynamic: license-file
18
+ Dynamic: summary
19
+
20
+ # rocket-rabia
21
+
22
+ A small Python package that models rockets for a game or a physics simulation.
23
+
24
+ ## Installation
25
+
26
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install it.
27
+
28
+ ```bash
29
+ pip install rocket-rabia
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```python
35
+ from rocket import Rocket, Shuttle, CircleRocket
36
+
37
+ r1 = Rocket(0, 0)
38
+ r2 = Rocket(3, 4)
39
+ print(r1.get_distance(r2)) # 5.0
40
+ print(r1 == r2) # False
41
+
42
+ c = CircleRocket(0, 0, 5)
43
+ print(c.get_area()) # 78.53981633974483
44
+ print(c.get_circumference()) # 31.41592653589793
45
+ ```
46
+
47
+ ## License
48
+ [MIT](https://choosealicense.com/licenses/mit/)
@@ -0,0 +1,7 @@
1
+ package_ta-1.0.0.dist-info/licenses/LICENSE.txt,sha256=FRF-WRcMYrI1TKI6jt2QOSb1TDYqEt78nRLltsdgLEM,1062
2
+ rocket/__init__.py,sha256=tUWyfDhkPM1ICU4jZwkxvfbAD1viGnqVQil-hYSvHRo,49
3
+ rocket/rocket.py,sha256=lJ4m_NrCrqSmY9UaEdO_1rnECo1Amy3W4wrayhAXT90,1922
4
+ package_ta-1.0.0.dist-info/METADATA,sha256=DmT5KPbule47A5wqxm6tk05xcdZ9NKLGW5RE2GEskWU,1120
5
+ package_ta-1.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
6
+ package_ta-1.0.0.dist-info/top_level.txt,sha256=iuGgWVgdNIZpR_FKX9YIEjWhtHhHoT4EJNDTvYSLF8Y,7
7
+ package_ta-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rabia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ rocket
rocket/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .rocket import Rocket, Shuttle, CircleRocket
rocket/rocket.py ADDED
@@ -0,0 +1,66 @@
1
+ # Save as rocket.py
2
+ from math import sqrt, pi
3
+
4
+
5
+ class Rocket():
6
+ # Rocket simulates a rocket ship for a game,
7
+ # or a physics simulation.
8
+
9
+ def __init__(self, x=0, y=0):
10
+ # Each rocket has an (x,y) position.
11
+ self.x = x
12
+ self.y = y
13
+
14
+ def move_rocket(self, x_increment=0, y_increment=1):
15
+ # Move the rocket according to the parameters given.
16
+ # Default behavior is to move the rocket up one unit.
17
+ self.x += x_increment
18
+ self.y += y_increment
19
+
20
+ def get_distance(self, other_rocket):
21
+ # Calculates the distance from this rocket to another rocket,
22
+ # and returns that value.
23
+ distance = sqrt((self.x - other_rocket.x)**2 + (self.y - other_rocket.y)**2)
24
+ return distance
25
+
26
+ def __eq__(self, other):
27
+ # Challenge 01: two rockets are equal if they have the same position.
28
+ if not isinstance(other, Rocket):
29
+ return False
30
+ return self.x == other.x and self.y == other.y
31
+
32
+ def __str__(self):
33
+ return f"A Rocket positioned at ({self.x},{self.y})"
34
+
35
+ def __repr__(self):
36
+ return f"Rocket({self.x},{self.y})"
37
+
38
+
39
+ class Shuttle(Rocket):
40
+ # Shuttle simulates a space shuttle, which is really
41
+ # just a reusable rocket.
42
+
43
+ def __init__(self, x=0, y=0, flights_completed=0):
44
+ super().__init__(x, y)
45
+ self.flights_completed = flights_completed
46
+
47
+
48
+ class CircleRocket(Rocket):
49
+ # CircleRocket models a rocket that has the form of a circle
50
+ # with radius r.
51
+
52
+ def __init__(self, x=0, y=0, r=1):
53
+ super().__init__(x, y)
54
+ self.r = r
55
+
56
+ def get_area(self):
57
+ return pi * self.r ** 2
58
+
59
+ def get_circumference(self):
60
+ return 2 * pi * self.r
61
+
62
+ def __str__(self):
63
+ return f"A CircleRocket positioned at ({self.x},{self.y}) with radius {self.r}"
64
+
65
+ def __repr__(self):
66
+ return f"CircleRocket({self.x},{self.y},{self.r})"