Added simple algorithm
This commit is contained in:
23
TMI-practicum/Circle.cs
Normal file
23
TMI-practicum/Circle.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user