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

Method add

libraries/AverageAngle/AverageAngle.cpp:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20uint32_t AverageAngle::add(float alpha, float length)
21{
22 if (_type == AverageAngle::DEGREES )
23 {
24 alpha *= DEG_TO_RAD; // (PI / 180.0);
25 }
26 else if (_type == AverageAngle::GRADIANS )
27 {
28 alpha *= GRAD_TO_RAD; // (PI / 200.0);
29 }
30 _sumx += (cos(alpha) * length);
31 _sumy += (sin(alpha) * length);
32 _count++;
33 return _count;
34}
35
36
37void AverageAngle::reset()

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36