diff --git a/airesources/Ruby/hlt/entity.rb b/airesources/Ruby/hlt/entity.rb index 76898499..92882d67 100644 --- a/airesources/Ruby/hlt/entity.rb +++ b/airesources/Ruby/hlt/entity.rb @@ -29,6 +29,8 @@ def calculate_distance_between(target) # return: Angle between entities in degrees (float) def calculate_angle_between(target) radians = Math.atan2(target.y - y, target.x - x) + radians = radians + 2 * Math::PI if radians < 0 + radians/Math::PI * 180 end