| TCH (statz) | ![]() #1, Főfasz (10579) |
309 | #5846 | ^ | Idézet | Mon, 07 Aug 2023 19:13:09 +02 |
| 94.21.*.* |
|
*.pool.digikabel.hu |
#include <math.h>
void calculate_xy_distance_by_angle(float angle_in_degrees, float distance, float *distance_x, float *distance_y)
{
const float rad = M_PI / 180.0;
*distance_x = distance * cos((angle_in_degrees + 270.0) * rad);
*distance_y = distance * cos(angle_in_degrees * rad);
} |