24 lines
458 B
C#
24 lines
458 B
C#
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace HYJig
|
|||
|
|
{
|
|||
|
|
public class XDrawable2D
|
|||
|
|
{
|
|||
|
|
public virtual void Draw(XGraphics g)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static int GetDistance(Point pt1, Point pt2)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
return (int)Math.Sqrt(Math.Pow((double)(pt1.X - pt2.X), 2.0) + Math.Pow((double)(pt1.Y - pt2.Y), 2.0));
|
|||
|
|
}
|
|||
|
|
catch
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|