Just another WordPress.com site

Basic Concept :
An ellipse is the set of points, {P}, such that the distance from P to a fixed point F1, plus the distance from P to a fixed point F2 is a constant for all points in the set .

That means that if there are three points named P , A , B and PA+PB=constant then this represents a ellipse .

The rope and the two posts define such a set, so the area the cow can move in is an ellipse . You have to calculate the area of an ellipse .

The area of an ellipse is a*b*pi where a and b are half the distance of the minor and major axes respectively.

factor a can be calculated by L/2 (the rope+two pillars form a line)
factor b can be calculated by sqrt((L/2)^2 – (D/2)^2) (the rope+two pillars form a triangle)

Since unit circle has area pi, this ellipse has area pi * a * b.

In the following the code of the above problem is given …You can give a galance of this .Have a better day .

Code :

#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;

#define PI 2*acos(0.0)

int main()
{
int test,i,D,L;
double a,b,res;
cin>>test;
for(i=0;i<test;i++)
{
cin>>D>>L;
a=L/2.0;
b=sqrt((L/2.0)*(L/2.0)-(D/2.0)*(D/2.0));
res=PI*a*b;
printf(“%.3lf\n”,res);
}
return 0;
}

ভয় পেয়োনা বন্ধু বরং
কণ্ঠ ছাড়ো জোরে
দেখা হবে তোমার আমার
অন্য নতুন ভোরে………।

ততদিন পর্যন্ত Goodbye

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: