pref: 换用卡马克的快速开方求倒函数
虽然用的地方不是很多()
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user