Skip to content

Commit

Permalink
update readme.md (#8)
Browse files Browse the repository at this point in the history
- update GitHub actions
- update license 2023
- update readme.md
- add performance sketch (initial version)
  • Loading branch information
RobTillaart committed Jan 31, 2023
1 parent 664d842 commit 7eb5036
Show file tree
Hide file tree
Showing 9 changed files with 394 additions and 25 deletions.
7 changes: 2 additions & 5 deletions Angle.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//
// FILE: Angle.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.1.13
// VERSION: 0.1.14
// PURPOSE: library for Angle math for Arduino
// URL: https://github.com/RobTillaart/Angle
// http://forum.arduino.cc/index.php?topic=339402
//
// HISTORY: see changelog.md


#include "Angle.h"
Expand All @@ -31,7 +29,6 @@ Angle::Angle(int dd, int mm, int ss, int tt)
m = mm;
s = ss;
t = tt;
// TODO
// normalize();
// assume only one (largest) parameter is negative at most...
if (d < 0) { d = -d; neg = true; }
Expand Down Expand Up @@ -318,7 +315,7 @@ int Angle::compare(const Angle &a, const Angle &b)
}


void Angle::normalize() // TODO CHECK
void Angle::normalize()
{
while (t < 0) { s--; t += 10000; }
while (t >= 10000) { s++; t -= 10000; }
Expand Down
9 changes: 5 additions & 4 deletions Angle.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
//
// FILE: Angle.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.13
// VERSION: 0.1.14
// PURPOSE: angle library for Arduino
// HISTORY: See angle.cpp
// URL: https://github.com/RobTillaart/Angle
// http://forum.arduino.cc/index.php?topic=339402
//
// AngleFormat proxy added 03/03/15 by Christoper Andrews.
//
Expand All @@ -15,7 +16,7 @@
#include "Printable.h"


#define ANGLE_LIB_VERSION (F("0.1.13"))
#define ANGLE_LIB_VERSION (F("0.1.14"))


class Angle;
Expand Down Expand Up @@ -97,5 +98,5 @@ class Angle: public Printable
};


// -- END OF FILE
// -- END OF FILE

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.1.14] - 2023-01-31
- update GitHub actions
- update license 2023
- update readme.md
- add performance sketch (initial version)


## [0.1.13] - 2022-10-12
- Add RP2040 support to build-CI
- Add CHANGELOG.md
Expand Down
54 changes: 42 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,31 @@ The library implements the Printable interface, allowing one to call

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

Degree sign ° = ALT-0176 (Windows)


#### Related

- https://github.com/RobTillaart/AngleConvertor
- https://github.com/RobTillaart/AverageAngle
- https://github.com/RobTillaart/Angle
- https://github.com/RobTillaart/runningAngle


## Interface

### Constructors
```cpp
#include "Angle.h"
```

#### 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)** create an Angle from a string e.g. "45.31234".


### base
#### Base

- **int sign()** returns -1 or 1.
- **int degree()** returns # degrees.
Expand All @@ -44,19 +58,21 @@ The library implements the Printable interface, allowing one to call
- **int tenthousand()** returns # ten-thousands of a second.


### Conversions
#### Conversions

- **double toDouble()** returns the angle as a double (0..360.0, float on UNO).
- **double toRadians()** returns the angle in radians (0..TWO_PI).
- **void fromRadian(double rad)** create an angle from radians.

More conversions - https://github.com/RobTillaart/AngleConvertor


### Equality operators
#### Equality operators

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


### Math operators
#### Math operators

- **negate** returns -angle.
- **addition** and **subtract** add angles to angles.
Expand All @@ -71,19 +87,33 @@ 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.
The library has not been tested extensively and it could still contain bugs.
Especially the constructor does not check input so use it carefully.


## Future

#### Must

- improve documentation
- test more
- optimize code where possible
- performance sketch

#### Should

- Test normalize code
- unit tests, sketch?
- test more
- TOCHECK in code
- improve code quality
- fix TODO in code
- use better variable names in code
- move all code to .cpp


#### Could

- optimize code where possible
- low priority
- move all code to .cpp
- change output format to confirm standard 4°12'14.1234"

#### Wont


Loading

0 comments on commit 7eb5036

Please sign in to comment.