airesources/Ruby/hlt/entity.rb
# target: The target to compare against. Responds to x & y.
# int min_distance: Minimum distance specified from the object's outer radius
# return: The closest point's coordinates (Position)
The target to compare against. Responds to x & y.
int min_distance: Minimum distance specified from the object's outer radius
return: The closest point's coordinates (Position)
The target to compare against . Responds to x & y . int min_distance : Minimum distance specified from the object ' s outer radius return : The closest point ' s coordinates ( Position )
def closest_point_to(target, min_distance=3)
    angle_rad = target.calculate_rad_angle_between(self)
    radius = target.radius + min_distance
    x = target.x + radius * Math.cos(angle_rad)
    y = target.y + radius * Math.sin(angle_rad)
    Position.new(x, y)
  end
def closest_point_to ( target , min_distance = 3 ) angle_rad = target . calculate_rad_angle_between ( self ) radius = target . radius + min_distance x = target . x + radius * Math . cos ( angle_rad ) y = target . y + radius * Math . sin ( angle_rad ) Position . new ( x , y ) end
target: The target to compare against.
target : The target to compare against .
target
<not_specific>
min_distance
<not_specific>