UVA Problem 438 – The Circumference of the Circle Solution

Problem Solving, UVa

 

 

#include<bits/stdc++.h>

#include<math.h>

#define pi 3.141592653589793



int main()

{

double x1,x2,y1,y2,x3,y3,a,b,c,s,radius,d,circle;



while(scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3) != EOF)

{

a=sqrt(pow((x1-x2),2)+pow((y1-y2),2));

b=sqrt(pow((x2-x3),2)+pow((y2-y3),2));

c=sqrt(pow((x3-x1),2)+pow((y3-y1),2));



s=(a+b+c)/2;



radius=a*b*c/(4*sqrt((s*(s-a)*(s-b)*(s-c))));



circle=2*pi*radius;



printf("%.2lf\n",circle);

}

return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...