mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 23:30:40 -04:00
Adjust polar to point and bearing drawing
This commit is contained in:
parent
863bb04091
commit
abb4385859
2 changed files with 6 additions and 3 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue