Skip to main content

A Simple Package For Angle Calculation

Project description

# PyAngle

![https://img.shields.io/badge/license-Apache%202.0-blue.svg?longCache=true&style=flat-square](https://img.shields.io/badge/license-Apache%202.0-blue.svg?longCache=true&style=flat-square)

> A simple package for angle calculation

# class Angle

> Designed especially for angle in the form of DMS(Degree, Minute and Second) > > immutable object > > default: public, non-static

## Member Variables

  • int degree

  • int minute

  • float second

## Member Methods

### Override

  • [x] __init__(form, degree, minute, second, rad, x, y)

  • [x] __add__(self, other): “+”

  • [x] __sub__(self, other): “-”

  • [x] __mul__(self, n): “*”

  • [x] __truediv__(self, n): “/”

  • [x] __floordiv__(self, n): “//”

  • [x] __mod__(self, other): “%

  • [x] __str__(self)

  • [x] __cmp__(self, other)

  • [x] __eq__(self, other): “==”

  • [x] __ne__(self, other): “!=”

  • [x] __le__(self, other): “<=”

  • [x] __lt__(self, other): “<”

  • [x] __ge__(self, other): “>=”

  • [x] __gt__(self, other): “>”

### Creator

  • [x] createByDMS(degree, minute, second)

  • [x] createByDegree(degree)

  • [x] createByRadian(rad)

  • [x] createByXY(x, y)

### Mutator

  • [x] void adjust(): 调整格式

### Producer

#### Calculators

  • [x] float sin()

  • [x] float cos()

  • [x] float tan()

### Observer

#### Getters

  • [x] int getDegree()

  • [x] int getMinute()

  • [x] float getSecond()

#### Switchers

  • [x] float toDegrees()

  • [x] float toRadians()

  • [x] (float, float) toXY(x, y): 坐标,x、y 两者之一不为 0

  • [x] String toString(format): 指定格式输出字符串,默认`xxx°xxx′xxx″`

#### Judges

  • [x] bool isZeroAngle(): 零角

  • [x] bool isAcuteAngle(): 锐角

  • [x] bool isRightAngle(): 直角

  • [x] bool isObtuseAngle(): 钝角

  • [x] bool isStraightAngle(): 平角

  • [x] bool isMajorAngle(): 优角

  • [x] bool isMinorAngle(): 劣角

### Static Methods

#### Producer

  • [ ] Angle[] toAnglesFromXYs((float, float)[] angles): 参数为(x, y)元组的列表

  • [ ] Angle[] toAnglesFromDegrees(float[] angles): 参数为 degree 元组的列表

  • [ ] Angle[] toAnglesFromRads(float[] angles): 参数为 rad 元组的列表

  • [ ] (float, float)[] toXYsFromAngles(Angle[] angles)

  • [ ] float[] toDegreesFromAngles(Angle[] angles)

  • [ ] float[] toRadsFromAngles(Angle[] angles)

  • [ ] Angle[] sort(Angle[] angles, bool reverse)

#### Chooser

  • [ ] Angle getBiggerAngle(angle1, angle2)

  • [ ] Angle getSmallerAngle(angle1, angle2)

  • [ ] Angle getNearestAngle(Angle angle, Angle[] angles): 在`angles`中找到与`angle`最近的角

  • [ ] Angle getFurthestAngle(Angle angle, Angle[] angles): 在`angles`中找到与`angle`最远的角

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyAngle-1.0.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

PyAngle-1.0.0-py3.6.egg (13.0 kB view details)

Uploaded Egg

PyAngle-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file PyAngle-1.0.0.tar.gz.

File metadata

  • Download URL: PyAngle-1.0.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for PyAngle-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aae10c8e57eedaecb7208adafb9260fe7f88d7913a11d3d9f9acb40680c6d993
MD5 f4ab9236bd9ee3a207dd58857b719638
BLAKE2b-256 8b2974e72b6da090deda361eff4a2a836018fbad10367670509cebff1b0c1bc9

See more details on using hashes here.

File details

Details for the file PyAngle-1.0.0-py3.6.egg.

File metadata

  • Download URL: PyAngle-1.0.0-py3.6.egg
  • Upload date:
  • Size: 13.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for PyAngle-1.0.0-py3.6.egg
Algorithm Hash digest
SHA256 da4b6585c136caa1d9f04b8fbfc12b4568290ba82af153ee155d5119e2033dd9
MD5 c8b200f90ffebed88ffa49d80796ee40
BLAKE2b-256 195582c418bc8d4eedfda9ea4fbf856defa8b092ced55c781d19411e80c98687

See more details on using hashes here.

File details

Details for the file PyAngle-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: PyAngle-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for PyAngle-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 597e42c78f3dece39d7bd6092b7a31f6935fc73e251b034fdbe34c6b150316c6
MD5 b7e44237d44d34e6216d672ceabde7fc
BLAKE2b-256 64f4be869d30f9b8e8a4c1f4b151efee90456c620c8b1f5a7c6a321a02b780d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page