Shortest distance between a point and a circle | Function to find the shortest distance ; Driver code
< ? php function dist ( $ x1 , $ y1 , $ x2 , $ y2 , $ r ) { echo " The ▁ shortest ▁ distance ▁ between ▁ a ▁ point ▁ and ▁ a ▁ circle ▁ is ▁ " , sqrt ( ( pow ( ( $ x2 - $ x1 ) , 2 ) ) + ( pow ( ( $ y2 - $ y1 ) , 2 ) ) ) - $ r ; } $ x1 = 4 ; $ y1 = 6 ; $ x2 = 35 ; $ y2 = 42 ; $ r = 5 ; dist ( $ x1 , $ y1 , $ x2 , $ y2 , $ r ) ; ? >