Metadata-Version: 2.4
Name: degrees
Version: 0.1.0
Summary: A python lib for degree calculations and conversions
Author-email: ArcticChar <snake830@vip.163.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# degrees V0.1.0
# Contents
* Introduction
* Class
  * Degree
* Functions
  * degree2radius
  * radius2degree
  * convert_to_360
* Changelog
# Introduction
A python lib for degree calculations and conversions
# Importing
### Just type `import degrees`.
# Class
- ## *class* degrees.Degree(degre: float)
  ## *class* degrees.Degree(degre: Degree)
  ## *class* degrees.Degree(degre: int = 0, minute: int = 0, second: int = 0)
   - ### Creating a Degree object
      ```python
      >>> degrees.Degree(1)
      1°
      >>> degrees.Degree(2, 3, 4)
      2°3'4"
      >>> degrees.Degree(1, second=2)
      1°0'2"
      >>> degrees.Degree(1, 3)
      1°3'
      >>> degrees.Degree(0, -1)
      -1'
      >>> degrees.Degree(2, -4)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
          degrees.Degree(2, -4)
          ~~~~~~^^^^^^
        File "/degrees.py", line 32, in __init__
          raise ValueError("if degree is not 0, minute and second must be positive integer")
      ValueError: if degree is not 0, minute and second must be positive integer
     ```

   - ### calculating:
     | `a + b`  | `a - b`        | `a * b`         | `a / b`               |
     |----------|----------------|-----------------|-----------------------|
     | `abs(a)` | `math.ceil(a)` | `math.floor(a)` | `a % b`               |
     | `a // b` | `+a`           | `-a`            | `hash(a)`<sup>1</sup> |

   - ### conversions:
     | `int(a)` | `float(a)` | `str(a)` | `repr(a)` | `bool(a)` |
     |----------|------------|----------|-----------|-----------|

   - ### comparisons:
     | `a >= b` | `a > b` | `a = b`  |
     |----------|---------|----------|
     | `a <= b` | `a < b` | `a != b` |
   
> ### Note
> 1. `hash(Degree_object)` is equal to `hash(id(Degree_object)).`<br>
> 2. The attributes of Degree are read-only.
# Functions
## *def* degree2radius(x: Degree, /)
   - Convert angle x from a degree object to radians.
## *def* radius2degree(x: Union[int, float], /)
   - Convert angle x from radians to a degree object.
## *def* convert_to_360(x: Degree, /)
   - Be using for angle normalization.
# Changelog
   1. Fixed a lot of problems
   2. Deleted `degree` `0.0.1`, `0.0.2`, `0.0.3` and `0.0.4` because there are too much bugs.
> ### Write in the end
> If you found the bug in the code, you can email me at `snake830@vip.163.com`. I'm happy to receive the advice!
