Test instructions: Finding the coordinates of the Braddock point
Idea: Direct use of the nature of the Brock card point. Http://pan.baidu.com/s/1eQiP76E
1#include <cstdio>2#include <cstring>3#include <algorithm>4#include <iostream>5#include <cstdlib>6#include <cstring>7#include <cmath>8#include <vector>9 #defineCLC (A, B) memset (A,b,sizeof (a))Ten using namespacestd; One Const Doubleeps=1e-8; A Const DoublePi=acos (-1); - Const intmaxn=1000010; - using namespacestd; the - intT; - intMain () - { + while(~SCANF ("%d",&t)) - { + while(t--) A { at intK; - Doublec,d,a,b,e,f,m1,m2,m3,k,q; - Doublex, y; -scanf"%D%LF%LF%LF%LF%LF%LF",&k,&a,&b,&e,&f,&c,&d); - DoubleL1,l2,l3; -l1= (A-E) * (A-E) + (b-f) * (b-f); inL2= (C-E) * (C-E) + (d-f) * (df); -l3= (c-a) * (c-a) + (d-b) * (db); tom1= (L1*L3*L3)/(l1*l2+l2*l3+l3*L1); +M2= (L3*L2*L2)/(l1*l2+l2*l3+l3*L1); -m3= (L2*L1*L1)/(l1*l2+l2*l3+l3*L1); the if(a!=c&&b!=d) * { $k= (-a+e)/(-a+c);Panax Notoginsengq= (-b+f)/(-b+d); -X= (e*e-b*b+ (1-Q) *m1-m3+q*m2+q* (b*b-c*c) +f*f-a*a+q* (a*a-d*d))/(2*q*a-2*q*c-2*a+2*e); theY= (E*e-b*b+m1* (1-K)-m3+k*m2+k* (b*b-c*c)-a*a+f*f+k* (a*a-d*d))/(2*k*b-2*k*d-2*b+2*f); +printf"%d%.5f%.5f\n", k,x,y); A } the Else if(a==c) + { -y= (M1-M2+D*D-B*B)/(-2*b+2*d); $X=a+sqrt (m1-(y-b) * (yb)); $printf"%d%.5f%.5f\n", k,x,y); - } - Else the { -x= (m1-m2+c*c-a*a)/(-2*a+2*c);WuyiY=b+sqrt (m1-(x-a) * (xa)); theprintf"%d%.5f%.5f\n", k,x,y); - } Wu } - } About return 0; $}
View Code
Winter Training Nineth Session Brocard Point of a Triangle