void function ( int arg0 , int arg1 ) { double loc0 = arg0 - x ; double loc1 = arg1 - y ; double loc2 = Math . sqrt ( loc0 * loc0 + loc1 * loc1 ) ; if ( loc2 > 0 ) { double loc3 = Math . sqrt ( dx * dx + dy * dy ) ; dx = loc0 / loc2 * loc3 ; dy = loc1 / loc2 * loc3 ; } }
adjust the direction of motion of the ball so that it is headed towards the point a , b . if the ball happens to lie exactly at the point a , b already , this operation is undefined , so nothing is done . concode_field_sep double ymin concode_elem_sep double xmin concode_elem_sep double ymax concode_elem_sep double xmax concode_elem_sep double dx concode_elem_sep Color color concode_elem_sep double dy concode_elem_sep double x concode_elem_sep double y concode_elem_sep double radius concode_field_sep void setSpeed concode_elem_sep void setColor concode_elem_sep void setLocation concode_elem_sep void setVelocity concode_elem_sep void setLimits concode_elem_sep void draw concode_elem_sep void travel concode_elem_sep void travel concode_elem_sep void setRadius