Question: (3) The shortest distance between a line given by the equation ax+by+c=0 and a point (x0,y0) is given by the equation minDist =a2+b2ax0+by0+c. a. Write

(3) The shortest distance between a line given by the equation ax+by+c=0 and a point (x0,y0) is given by the equation minDist =a2+b2ax0+by0+c. a. Write a script that calculates minDist, given the constants a,b,c and the point ( x0,y0). Encode the point (x0,y0) as an array (e.g., point =[x,y]) b. Extend your script to determine whether a circle of radius r traveling with its center point along the line ax+by+c=0 will collide with the point (x0,y0). Hint: this occurs if r> minDist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
