GY-63_MS5611/libraries/Angle
2021-01-29 12:31:58 +01:00
..
.github/workflows 2021-01-29 2021-01-29 12:31:58 +01:00
examples + fix for negative values bug - beta version to be verified 2015-10-19 20:15:06 +02:00
test 2021-01-29 2021-01-29 12:31:58 +01:00
.arduino-ci.yml 2021-01-29 2021-01-29 12:31:58 +01:00
Angle.cpp 2021-01-29 2021-01-29 12:31:58 +01:00
Angle.h 2021-01-29 2021-01-29 12:31:58 +01:00
keywords.txt 2021-01-29 2021-01-29 12:31:58 +01:00
library.json 2021-01-29 2021-01-29 12:31:58 +01:00
library.properties 2021-01-29 2021-01-29 12:31:58 +01:00
LICENSE 2021-01-29 2021-01-29 12:31:58 +01:00
README.md 2021-01-29 2021-01-29 12:31:58 +01:00
Warning.txt + fix for negative values bug - beta version to be verified 2015-10-19 20:15:06 +02:00

Arduino CI License: MIT GitHub release

Angle

Arduino library for basic math for Angles in degrees, minute, seconds and tenthousands.

Description

Angle is an Arduino class to print, compare and do basic math with angles in degrees, minutes seconds and tenthousands. The class was created to be able to print an angle with minutes and seconds instead of as a floating point or radians.

To make the library more useful basic math ( + - * / ) and comparisons ( == != < <= > >= ) are added to the class.

The library implements the Printable interface, allowing one to call

Serial.println(angle) or SD.print(angle)

Interface

Constructors

  • Angle(int dd=0, int mm=0, int ss=0, int tt=0) create an Angle, default is zero.
  • Angle(double alpha) create an Angle from a double.
  • Angle(char * str) creat an Angle from a string e.g. "45.31234".

base

  • int sign() returns -1 or 1
  • int degree() returns # degrees
  • int minute() returns # minutes
  • int second() returns # seconds
  • int tenthousand() returns # tenthousands of a second

Conversions

  • toDouble() returns the angle as a double (float)
  • toRadians() retuns the angle in radians (0..TWO_PI)
  • fromRadian()

Equality operators

The library supports equality operator "==", "!=", "<" "<=" ">" and ">="

Math operators

  • negate -angle
  • addition and subtract add angles to angles
  • multiplication and division multiply an angle with a double
  • ratio ratio = Angle/Angle;

Operation

See examples

Note

The library has not been tested extensively and it could still contain bugs. Especially the constructor does not check input so use it carefully.