private static void Main(string[] args) { ProtonsPoint p = ReadPoint(); ProtonsPoint otherP = ReadPoint(); Console.WriteLine(p.Distance(otherP)); p.MoveTo(5, 78); Console.WriteLine(p.TransformToString()); Console.ReadKey(); }
public double Slope(ProtonsPoint anotherP) { return((this.y - anotherP.y) / (this.x - anotherP.x)); }
public double Distance(ProtonsPoint anotherP) { return(Math.Sqrt(Math.Pow(this.x - anotherP.x, 2) + Math.Pow(this.y - anotherP.y, 2))); }