mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 05:59:51 +00:00
Adjust polar to point and bearing drawing
This commit is contained in:
@@ -91,7 +91,9 @@ Rect& Rect::operator-=(const Point& p) {
|
||||
}
|
||||
|
||||
Point polar_to_point(float angle, uint32_t distance) {
|
||||
return Point(sin_f32(DEG_TO_RAD(angle) + (pi / 2)) * distance, -sin_f32(DEG_TO_RAD(angle)) * distance);
|
||||
//polar to compass with y negated for screen drawing
|
||||
return Point(sin_f32(DEG_TO_RAD(-angle) + pi) * distance,
|
||||
sin_f32(DEG_TO_RAD(-angle) - (pi / 2)) * distance);
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
||||
|
Reference in New Issue
Block a user