using RichCreator.Utility.Structs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RichCreator.Utilitys
{
public class Utils
{
///
/// 计算两点之间的距离
///
///
///
///
public static double GetDistance(ZTPoint start, ZTPoint end)
{
Int32 subX = end.X - start.X;
Int32 subY = end.Y - start.Y;
return Math.Sqrt(subX * subX + subY * subY);
}
///
/// 指定点是否在方框内
///
///
///
///
public static bool IsInRect(ZTPoint point, ZTRectangle rect)
{
if (point.Y >= rect.Start.Y &&
point.Y <= rect.End.Y &&
point.X >= rect.Start.X &&
point.X <= rect.End.X)
{
return true;
}
return false;
}
}
}