Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
100题留念 自己研究出计算三角形外心的超长的公式 贴代码Program poj2242; type t_v=record x,y:extended;end; const pai=3.1415926535897932384626433832795028841971693993751058; var v1,v2,v3,v:t_v; function dis(v1,v2:t_v):extended; begin exit(sqrt(sqr(v1.x-v2.x)+sqr(v1.y-v2.y))); end; procedure waixin(v1,v2,v3:t_v; var v:t_v); var p,q,r:extended; begin p:=v1.y-v2.y; q:=v2.y-v3.y; r:=v3.y-v1.y; v.x:=(q*(sqr(v1.x)+sqr(v1.y))+r*(sqr(v2.x)+sqr(v2.y))+p*(sqr(v3.x)+sqr(v3.y)))/(2*(v1.x*q+v2.x*r+v3.x*p)); p:=v1.x-v2.x; q:=v2.x-v3.x; r:=v3.x-v1.x; v.y:=(q*(sqr(v1.x)+sqr(v1.y))+r*(sqr(v2.x)+sqr(v2.y))+p*(sqr(v3.x)+sqr(v3.y)))/(2*(v1.y*q+v2.y*r+v3.y*p)); end; Begin while not eof do begin readln(v1.x,v1.y,v2.x,v2.y,v3.x,v3.y); waixin(v1,v2,v3,v); writeln(2*pai*dis(v1,v):0:2); end; End. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator