static void Main(string[] args) { Punkt p1 = new Punkt(); Punkt p2 = new Punkt(); p1.x = 3; p1.y = 4; p2.x = 10; p2.y = 20; p1.Wypisz(); p2.Wypisz(); }
static void Main(string[] args) { Punkt p1 = new Punkt(3, 4); Console.WriteLine($"{p1} - {p1.ComputeAbsoluteDistance()}"); }
public double ComputeAbsoluteDistance() { var origin = new Punkt(0, 0); return(this.dist(origin)); }
public double dist(Punkt p) { return(Math.Sqrt((this.X - p.X) * (this.X - p.X) + (this.Y - p.Y) * (this.Y - p.Y))); }
public bool CzyTworzyTrojkat(Punkt p1, Punkt p2) { return(Math.Abs((p1.x - x) * (p2.y - y) - (p1.y - y) * (p2.x - x)) != 0); }