Hypothenusen und Katheten berechnen
using System;
namespace Pythagoras
{
class Pythagoras
{
public double HypothenuseBerechnen(double Kathete,double Ankathete)
{
double hypothenuse = Math.Pow(Math.Pow(Kathete, 2) + Math.Pow(Ankathete, 2), 1 / 2);
return hypothenuse;
}
public double KatheteBerechnen(double hypothenuse,double ankathete)
{
double kathete = Math.Pow(Math.Pow(hypothenuse, 2) - Math.Pow(ankathete, 2), 1 / 2);
return kathete;
}
}
}
2 Kommentare zum Snippet