31 lines
924 B
C#
31 lines
924 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WeldingCommon.Tools
|
|
{
|
|
public static class CommonChecker
|
|
{
|
|
public static bool CheckInside(this double current, double target, double Gap)
|
|
{
|
|
if ((target - Gap) < current && current < (target + Gap))
|
|
return true;
|
|
return false;
|
|
}
|
|
public static bool CheckInsideRelMinMax(this double current, double target, double minRel, double maxRel)
|
|
{
|
|
if ((target + minRel) < current && current < (target + maxRel))
|
|
return true;
|
|
return false;
|
|
}
|
|
public static bool CheckInside(this int current, int target, int Gap)
|
|
{
|
|
if ((target - Gap) < current && current < (target + Gap))
|
|
return true;
|
|
return false;
|
|
}
|
|
}
|
|
}
|