コード例 #1
0
ファイル: MathUtils.cs プロジェクト: Alex1473/Simplificator
        internal static double CalculateSquareDistance(CoordPoint a, CoordPoint b)
        {
            double dx = b.GetX() - a.GetX();
            double dy = b.GetY() - a.GetY();

            return(dx * dx + dy * dy);
        }
コード例 #2
0
ファイル: MathUtils.cs プロジェクト: Alex1473/Simplificator
 public static double CalculateSquare(CoordPoint a, CoordPoint b, CoordPoint c)
 {
     return(0.5 * Math.Abs((a.GetX() - b.GetX()) * (c.GetY() - b.GetY()) - (c.GetX() - b.GetX()) * (a.GetY() - b.GetY())));
 }