Shortest distance from the centre of a circle to a chord | Java program to find the shortest distance from chord to the centre of circle ; Function to find the shortest distance ; Driver code
class GFG { static void shortdis ( double r , double d ) { System . out . println ( " The ▁ shortest ▁ distance ▁ " + " from ▁ the ▁ chord ▁ to ▁ centre ▁ " + ( Math . sqrt ( ( r * r ) - ( ( d * d ) / 4 ) ) ) ) ; } public static void main ( String [ ] args ) { double r = 4 , d = 3 ; shortdis ( r , d ) ; } }