Metadata-Version: 2.1
Name: quadrantic
Version: 0.1.0
Summary: Determination of quadrants based on angle, coordinates and others
Home-page: https://github.com/earthobservations/quadrantic
License: MIT
Keywords: open-source,quadrant,geometry,plane-geometry,point,coordinates
Author: Benjamin Gutzmann
Author-email: gutzemann@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Dist: Shapely (>=1.8.4,<2.0.0)
Requires-Dist: matplotlib (>=3.6.0,<4.0.0)
Project-URL: Issues, https://github.com/earthobservations/quadrantic/issues
Project-URL: Repository, https://github.com/earthobservations/quadrantic
Project-URL: Releases, https://github.com/earthobservations/quadrantic/releases
Description-Content-Type: text/x-rst

quadrantic
##########

Determination of quadrants based on angle, coordinates and others

Overview
********

This library allows you to determine quadrant(s) based on

- angle (360° or 400 Gon)
- location (latlon)

Setup
*****

Via Pip:

.. code-block:: bash

    pip install quadrantic

Via Github (latest):

.. code-block:: bash

    pip install git+https://github.com/earthobservations/quadrantic

Implementations
***************

Get quadrant for angle
======================

Determine quadrant based on

Degree

.. code-block::

    #####################
    #         # 90°     #
    #         #         #
    # 180°    #      0° #
    #####################
    #         #         #
    #         #         #
    #         # 270°    #
    #####################

or

Gon

.. code-block::

    #####################
    #         # 100°    #
    #         #         #
    # 200°    #      0° #
    #####################
    #         #         #
    #         #         #
    #         # 300°    #
    #####################

.. code-block:: python

    from quadrantic import QuadrantFromAngle, AngleUnit, Q

    quad = QuadrantFromAngle() # no args need for this method

    # Single quadrant
    quad.get(45.0, AngleUnit.DEGREE)
    # [Q.FIRST]

    # Two quadrants
    quad.get(90.0, AngleUnit.DEGREE)
    # [Q.FIRST, Q.SECOND]

    # More then full circle (360°)
    quad.get(450.0, AngleUnit.DEGREE) # same as above + 360°
    # [Q.FIRST, Q.SECOND]

    # Negative degree
    quad.get(-45.0, AngleUnit.DEGREE)
    # [Q.FOURTH]

    # Degree in Gon
    quad.get(90.0, AngleUnit.GON)
    # [Q.FIRST]

Get quadrant for coordinates
============================

.. code-block::

    #####################
    # (-1,1)  #   (1,1) #
    #         #         #
    #         # (0,0)   #
    #####################
    #         #         #
    #         #         #
    #         #         #
    #####################

.. code-block:: python

    from quadrantic import QuadrantFromCoords, AngleUnit, Q
    from shapely.geometry import Point

    # Single quadrant
    quad = QuadrantFromCoords((0.0, 0.0))
    quad.get((1.0, 1.0))
    # [Q.FIRST]

    # Two quadrants
    quad = QuadrantFromCoords((0.0, 0.0))
    quad.get((0.0, 1.0))
    # [Q.FIRST, Q.SECOND]

    # All quadrants
    quad = QuadrantFromCoords((0.0, 0.0))
    quad.get((0.0, 0.0))
    # [Q.FIRST, Q.SECOND, Q.THIRD, Q.FOURTH]

    # Single quadrant with shapely Point
    quad = QuadrantFromCoords(Point(0.0, 0.0))
    quad.get(Point(1.0, 1.0))
    # [Q.FIRST]

Examples
********

Visualized examples can be found in the ``examples`` folder.

License
*******

Distributed under the MIT License. See ``LICENSE.rst`` for more info.

Changelog
*********

Development
===========

0.1.0 (25.09.2022)
==================

- Add first version of quadrantic

