Metadata-Version: 2.4
Name: degrees
Version: 0.1.4
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.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# degrees V0.1.4
# Contents
* Introduction
* Importing
* 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(number)
  ## _class_ degrees.Degree(degree_obj)
  ## _class_ degrees.Degree(degree=0, minute=0, second=0)
   - ### Creating a Degree object
      ```python
      >>> import degrees
      >>> 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)` |

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

   - ### comparisons:
     | `a >= b` | `a > b` | `a = b`  |
     |----------|---------|----------|
     | `a <= b` | `a < b` | `a != b` |

   - ### _staticmethod_ from_str(string)
      Return a degree object from a string.
   - ### _staticmethod_ from_iter(iterable)
      Return a degree object from an iterable.
   - ### _functools.cached_property_ total_seconds
      The total seconds of a degree object.
   - ### deg
      The degree of a degree object(without sign).
   - ### min
      The minute of a degree object(without sign).
   - ### sec
      The second of a degree object(without sign).
   - ### sign
      The sign of a degree object.
   - ### _property_ dms
      A tuple of `(degree, minute, second)`.
   
> ### Note
> 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.
# Version
## version_info
   - The version of this package, like
[`sys.version_info`](https://docs.python.org/3.14/library/sys.html#sys.version_info).
# Changelog
   1. Yanked degrees `0.1.2` because the bug in `Degree.__init__`.
> ### Write in the end
> If you found the bug in the code, you can email me at `snake830@vip.163.com`. I am happy to receive the advice!
