using
System;
class
GFG{
class
pair
{
public
float
first, second;
public
pair(
float
first,
float
second)
{
this
.first = first;
this
.second = second;
}
}
static
float
distance(
int
m,
int
n,
int
p,
int
q)
{
return
(
float
)Math.Sqrt(Math.Pow(n - m, 2) +
Math.Pow(q - p, 2) * 1.0);
}
static
void
Excenters(
int
x1,
int
y1,
int
x2,
int
y2,
int
x3,
int
y3)
{
float
a = distance(x2, x3, y2, y3);
float
b = distance(x3, x1, y3, y1);
float
c = distance(x1, x2, y1, y2);
pair[] excenter =
new
pair[4];
excenter[1] =
new
pair((-(a * x1) + (b * x2) +
(c * x3)) / (-a + b + c),
(-(a * y1) + (b * y2) +
(c * y3)) / (-a + b + c));
excenter[2] =
new
pair(((a * x1) - (b * x2) +
(c * x3)) / (a - b + c),
((a * y1) - (b * y2) +
(c * y3)) / (a - b + c));
excenter[3] =
new
pair(((a * x1) + (b * x2) -
(c * x3)) / (a + b - c),
((a * y1) + (b * y2) -
(c * y3)) / (a + b - c));
for
(
int
i = 1; i <= 3; i++)
{
Console.WriteLine((
int
)excenter[i].first +
" "
+
(
int
)excenter[i].second);
}
}
static
void
Main()
{
int
x1, x2, x3, y1, y2, y3;
x1 = 0;
x2 = 3;
x3 = 0;
y1 = 0;
y2 = 0;
y3 = 4;
Excenters(x1, y1, x2, y2, x3, y3);
}
}