using System; public class Test { public class Vector2 { public double X; public double Y; public Vector2(double X, double Y) { this.X = X; this.Y = Y; } } private static bool IsInEclipse(Vector2 position, Vector2 center, Vector2 radius) { bool result = false; var powResult = Math.Pow(position.X - center.X, 2.0d) / (radius.X * radius.X) + Math.Pow(position.Y - center.Y, 2.0d) / (radius.Y * radius.Y); if (powResult <= 1) { result = true; } return result; } public static void Main() { Console.WriteLine(IsInEclipse( new Vector2(360, 640), new Vector2(683, 423), new Vector2(700, 460) )); } }