Equation of circle from center and radius | CPP program to find the equation of circle . ; Function to find the equation of circle ; Printing result ; Driver code
#include <iostream> NEW_LINE using namespace std ; void circle_equation ( double x1 , double y1 , double r ) { double a = -2 * x1 ; double b = -2 * y1 ; double c = ( r * r ) - ( x1 * x1 ) - ( y1 * y1 ) ; cout << " x ^ 2 ▁ + ▁ ( " << a << " ▁ x ) ▁ + ▁ " ; cout << " y ^ 2 ▁ + ▁ ( " << b << " ▁ y ) ▁ = ▁ " ; cout << c << " . " << endl ; } int main ( ) { double x1 = 2 , y1 = -3 , r = 8 ; circle_equation ( x1 , y1 , r ) ; return 0 ; }