Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这题是解三角形

Posted by ZZU20142480127 at 2016-03-29 20:19:39 on Problem 2242
这题是解三角形,适合高中生做,大家在高二一定能做出来。
三个公式
海伦公式
三角形正弦定理
三角形面积公式
s= (a*b) sin(C) / 2 ;
s= sqrt( p* (p-a) * (p-b) * (p-c))
a/sin(A)==b/(sin (B))==c / sin(C) == 三角形外接圆直径


# include <stdio.h>
# include <string.h>
# include <math.h>
# define PII 3.141592653589793

double dot[6];
int main(){
	while(~scanf("%lf%lf%lf%lf%lf%lf",&dot[0],&dot[1],&dot[2],&dot[3],&dot[4],&dot[5])){
		double a=0,b=0,c=0,p=0,d=0,s=0,ans=0;
		
		a=sqrt( (dot[0]-dot[2]) * (dot[0]-dot[2]) + (dot[1]-dot[3])* (dot[1]-dot[3]));		
		b=sqrt( (dot[0]-dot[4]) * (dot[0]-dot[4]) + (dot[1]-dot[5])* (dot[1]-dot[5]));
		c=sqrt( (dot[2]-dot[4]) * (dot[2]-dot[4]) + (dot[5]-dot[3])* (dot[5]-dot[3]));
		p=(a+b+c)/2.0;
		s=sqrt(p*(p-a)*(p-b)*(p-c));
		d=a*b*c/(s*2);
		
		//printf(" zhijing   %lf\n",d);
		ans=PII*d; 
     	printf("%.2lf\n",ans);
	}
	
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator