Question: C++ programming pag 1 check pag2 I have already given you the code for the function named circle_x_coord to compute the x coordinate of the
I have already given you the code for the function named "circle_x_coord" to compute the x coordinate of the center of a circle given three points on the circle. Your task is to make a main routine and call the function to compute yc (y coordinate of the center of a circle) and r (the radius of the circle). Three points are Pl-1-1) P2-(.1):P3-(3,-1) float circle_x coord(float x1, float yl, float x2, float y2, float x3, float y3) * Declare variables.* float xc_top, xc bottom, m12, m23 Compute slopes of the two lines between points. m12- (y2-yl)/(x2-xl) m23-(y3-y2)/(x3-x2); Compute the x coordinate of the center of the circle. xc top m12 * m23*(yl-y3)+m23*x+x2)-m12 (x2+x3) xc bottom-2*(m23-m12); xc xc top/xc bottom Return the x coordinate of the center. return xc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
