pref: 换用卡马克的快速开方求倒函数

虽然用的地方不是很多()
This commit is contained in:
bmy
2024-03-10 20:02:40 +08:00
parent c1e2b75aa5
commit ae70d9388e
5 changed files with 39 additions and 17 deletions

View File

@@ -12,7 +12,7 @@ float calculate_vector_angle(float x1, float y1, float x2, float y2)
float dx = x2 - x1;
float dy = y2 - y1;
float vector_length = sqrt(dx * dx + dy * dy);
float vector_length = Q_sqrt(dx * dx + dy * dy);
float angle_radians = acos(dx / vector_length);
float angle_degrees = angle_radians * 180 / M_PI;