#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
#define M 30
#define eps 1e-7
const double PI = acos(-);
class pnt_type
{
public:
double x,y;
};
class state_type
{
public:
double angle;
double CoverArea;
};
pnt_type pnt[M];
pnt_type center;
int n;
double R;
bool read_data()
{
n = ;
int i;
if (cin >> pnt[].x >> pnt[].y)
{
for (i=; i<=n; i++) cin >> pnt[i].x >> pnt[i].y;
cin >> center.x >> center.y >> R;
return true;
}
return false;
}
inline double Area2(pnt_type &a,pnt_type &b,pnt_type &c)
{
return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
inline double dot(pnt_type &a,pnt_type &b,pnt_type &c)
{
return (b.x - a.x) * (c.x - a.x) + (b.y - a.y) * (c.y - a.y);
}
inline double dist(pnt_type &a,pnt_type &b)
{
return sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y));
}
void init()
{
int i;
double temp,sum;
for (i=; i<n; i++)
{
temp = Area2(pnt[],pnt[i],pnt[i + ]);
sum += temp;
}
if (sum < ) reverse(pnt + ,pnt + n + );
pnt[n + ] = pnt[];
}
inline bool inCircle(pnt_type &s)
{
return dist(center,s) <= R;
}
bool SameSide(pnt_type a,pnt_type b)
{
if (dist(a,center) > dist(b,center)) swap(a,b);
return dot(a,b,center) < eps;
}
double ShadomOnCircle(pnt_type a,pnt_type b)
{
double flag = Area2(center,a,b),res = ;
if (fabs(flag) < eps) return ;
bool ina = inCircle(a),inb = inCircle(b);
if (ina && inb)
{
res = fabs(Area2(center,a,b)) / ;
}
else if (!ina && !inb)
{
if (SameSide(a,b))
{
double theta = acos(dot(center,a,b) / dist(center,a) / dist(center,b));
res = R * R * theta / ;
}
else
{
double height = fabs(Area2(center,a,b)) / dist(a,b);
double theta = acos(dot(center,a,b) / dist(center,a) / dist(center,b));
if (height >= R)
{
res = R * R * theta / ;
}
else
{
double _theta = * acos(height / R);
res = R * R * (theta - _theta) / + R * R * sin(_theta) / ;
}
}
}
else
{
if (!ina && inb) swap(a,b);
double height = fabs(Area2(center,a,b)) / dist(a,b);
double temp = dot(a,center,b);
double theta = acos(dot(center,a,b) / dist(center,a) / dist(center,b)),theta1,theta2;
if (fabs(temp) < eps)
{
double _theta = acos(height / R);
res += R * height / * sin(_theta);
res += R * R / * (theta - _theta);
}
else
{
theta1 = asin(height / R);
theta2 = asin(height / dist(a,center));
if (temp > )
{
res += dist(center,a) * R / * sin(PI - theta1 - theta2);
res += R * R / * (theta + theta1 + theta2 - PI);
}
else
{
res += dist(center,a) * R / * sin(theta2 - theta1);
res += R * R / * (theta - theta2 + theta1);
}
}
}
if (flag < ) return -res;
else return res;
}
double Cover()
{
int i;
double res = ;
for (i=; i<=n; i++)
res += ShadomOnCircle(pnt[i],pnt[i + ]);
return res;
}
int main()
{
double ans;
while (read_data())
{
init();
ans = Cover();
printf("%.2lf\n",ans);
}
return ;
}