コード例 #1
0
 /// <summary>
 /// Calculate de distance to the other point 
 /// </summary>
 /// <param name="other">other point 2d</param>
 /// <returns>distance by pitagoras</returns>
 public double DistanceTo(Point2D other)
 {
     var x = _x - other.X;
     var y = _y - other.Y;
     return (Math.Sqrt(x*x+y*y)); //Math.Sqrt it's the same as make ¿square root?
 }
コード例 #2
0
 /// <summary>
 /// constructor with other point
 /// </summary>
 /// <param name="other">other point2D</param>
 public Point2D(Point2D other)
 {
     _x = other.X;
     _y = other.Y;
 }
コード例 #3
0
ファイル: Point2D.cs プロジェクト: slagusev/DllGameMaker
 /// <summary>
 /// constructor with other point
 /// </summary>
 /// <param name="other">other point2D</param>
 public Point2D(Point2D other)
 {
     _x = other.X;
     _y = other.Y;
 }