MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getAverage

Method getAverage

libraries/AverageAngle/AverageAngle.cpp:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51float AverageAngle::getAverage()
52{
53 float angle = atan2(_sumy, _sumx);
54 if (angle < 0) angle += TWO_PI; // (PI * 2);
55 if (_type == AverageAngle::DEGREES )
56 {
57 angle *= RAD_TO_DEG; // (180.0 / PI);
58 }
59 else if (_type == AverageAngle::GRADIANS )
60 {
61 angle *= RAD_TO_GRAD; // (200.0 / PI);
62 }
63 return angle;
64}
65
66
67float AverageAngle::getTotalLength()

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36