23 lines
477 B
C#
23 lines
477 B
C#
using System;
|
|
|
|
namespace TMI_practicum
|
|
{
|
|
public class Circle
|
|
{
|
|
public readonly double X;
|
|
public readonly double Y;
|
|
public readonly double R;
|
|
|
|
public Circle(double x, double y, double r)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
R = r;
|
|
}
|
|
|
|
public double Distance(Circle otherCircle)
|
|
{
|
|
return Math.Sqrt(Math.Pow(X - otherCircle.X, 2) + Math.Pow(Y - otherCircle.Y, 2));
|
|
}
|
|
}
|
|
} |