Пример #1
0
 public static double hypotenuseSquare(XYCoord n) => n.x * n.x + n.y * n.y;
Пример #2
0
 //Create a function which takes an x, y coordinate struct and returns a double
 // corresponding to the hypotenuse of a triangle with sides of lengths x, y.
 //Func<XYCoord, double> hypotenuse = n => Math.Sqrt(Math.Pow(n.x, 2) + Math.Pow(n.y, 2));
 public static double hypotenuse(XYCoord n) => Math.Sqrt(Math.Pow(n.x, 2) + Math.Pow(n.y, 2));