text: Shortest distance from the centre of a circle to a chord | C ++ program to find the shortest distance from chord to the centre of circle ; Function to find the shortest distance ; Driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; void shortdis ( double r , double d ) { cout << " The ▁ shortest ▁ distance ▁ " << " from ▁ the ▁ chord ▁ to ▁ centre ▁ " << sqrt ( ( r * r ) - ( ( d * d ) / 4 ) ) << endl ; } int main ( ) { double r = 4 , d = 3 ; shortdis ( r , d ) ; return 0 ; }