public void SetRange2(double left, double right) { AssertValidRange(left, right); Value2Left = left; Value2Right = right; v2Direction = right > left; reverseMap = IsSameDirection(); Range2 = ValueInterval.CloseClose(Math.Max(right, left), Math.Min(right, left)); CalculateRatos(); }
public ValueMapper(double value1Left, double value1Right, double value2Left, double value2Right) { Value1Left = value1Left; Value2Left = value2Left; Value1Right = value1Right; Value2Right = value2Right; //如果两组数据的left-->right的方向不一样,则作对称映射 //不用考虑相等的情况,如果left和right相等,new ValueRange会抛出异常 v1Direction = value1Right > value1Left; v2Direction = value2Right > value2Left; reverseMap = IsSameDirection(); Range1 = ValueInterval.CloseClose(Math.Max(value1Right, value1Left), Math.Min(value1Right, value1Left)); Range2 = ValueInterval.CloseClose(Math.Max(value2Right, value2Left), Math.Min(value2Right, value2Left)); CalculateRatos(); }