Skip to main content

A Simple Package For Angle Calculation

Project description

PyAngle

A simple package for angle calculation

Use

pip install PyAngle

class Angle

Designed especially for angle in the form of DMS(Degree, Minute and Second)

immutable object

default: public, non-static

APIs

Creators

  • from_dms()
  • from_degrees()
  • from_rad()
  • from_atan2()

Operators

  • __add__(self, other): "+"
  • __sub__(self, other): "-"
  • __mul__(self, n): "*"
  • __truediv__(self, n): "/"
  • __floordiv__(self, n): "//"
  • __mod__(self, other): "%
  • __str__(self)
  • __cmp__(self, other)
  • __eq__(self, other): "=="
  • __ne__(self, other): "!="
  • __le__(self, other): "<="
  • __lt__(self, other): "<"
  • __ge__(self, other): ">="
  • __gt__(self, other): ">"

Calculators

  • float sin()
  • float cos()
  • float tan()

Getters

  • int get_deg()
  • int get_min()
  • float get_sec()

Switchers

  • float to_degrees()
  • float to_rad()
  • (float, float) to_atan2(x=None, y=None)
  • String to_fmt_str(fmt="xxx°xxx′xxx″", decimal=2)

Judges

  • bool is_zero_angle(): 零角
  • bool is_acute_angle(): 锐角
  • bool is_right_angle(): 直角
  • bool is_obtuse_angle(): 钝角
  • bool is_straight_angle(): 平角
  • bool is_major_angle(): 优角
  • bool is_minor_angle(): 劣角

Future Features

  • Support sort()
  • 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 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-2.0.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Supported by

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