static void Main(string[] args) { Func <double, double> Perimetr = (radius) => 2 * Math.PI * radius; Func <double, double> Square = (radius) => Math.PI * radius * radius; var circle = new Circle.Core.Circle(1.5); Console.WriteLine($"Perimetr = {circle.Calculate((r) => 2 * Math.PI * r)}; Square = {circle.Calculate((r) => Math.PI * r * r)}; Diametr = {circle.Calculate(r => r * 2)}"); }
private static void Main(string[] args) { const double circleRadius = 1.5; var circle = new Circle.Core.Circle(circleRadius); //Console.WriteLine(circle.Calculate(r => 2 * Math.PI * r)); //Console.WriteLine(circle.Calculate(r => Math.PI * r * r)); //Console.WriteLine(circle.Calculate(r => 2 * r)); Console.WriteLine(circle.Calculate(r => 2 * Math.PI * r)); Console.WriteLine(circle.Calculate(r => Math.PI * r * r)); Console.WriteLine(circle.Calculate(r => 2 * r)); }
static void Main(string[] args) { double radius = 1.5; var circle1 = new Circle.Core.Circle(radius); //Console.WriteLine($"For the circle with radius {radius}"); //Console.WriteLine("Perimetr: " + circle1.GetPerimetr(radius)); //Console.WriteLine("Square: " + circle1.GetSquare(radius)); //Console.WriteLine(circle1.Calculate(circle1.GetPerimetr)); //Console.WriteLine(circle1.Calculate(circle1.GetSquare)); Console.WriteLine(circle1.Calculate(x => 2 * Math.PI * x)); Console.WriteLine(circle1.Calculate(x => 2 * Math.PI * x)); Console.WriteLine(circle1.Calculate(x => 2 * radius)); }