Add extrapolation, debug graphic limits
This commit is contained in:
@@ -25,7 +25,7 @@ namespace StructureHelperCommon.Models.Functions.Decorator
|
||||
}
|
||||
public override double GetByX(double xValue)
|
||||
{
|
||||
if (xValue > leftBound && xValue < rightBound)
|
||||
if (xValue >= leftBound && xValue <= rightBound)
|
||||
{
|
||||
return base.GetByX(xValue);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,14 @@ namespace StructureHelperCommon.Models.Functions.Decorator
|
||||
{
|
||||
graphLimitGraphPoint.Add(point);
|
||||
}
|
||||
else if (point.Y <= downBound)
|
||||
{
|
||||
graphLimitGraphPoint.Add(new GraphPoint(point.X, downBound));
|
||||
}
|
||||
else
|
||||
{
|
||||
graphLimitGraphPoint.Add(new GraphPoint(point.X, upBound));
|
||||
}
|
||||
}
|
||||
graphLimitGraphPoint.Add(upPoint);
|
||||
graphSettings.GraphPoints = graphLimitGraphPoint;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public class GraphPoint : ICloneable
|
||||
{
|
||||
public bool Exclude { get; set; }
|
||||
public bool Visible { get; set; }
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Exclude = false;
|
||||
Visible = true;
|
||||
}
|
||||
public object Clone()
|
||||
{
|
||||
|
||||
@@ -82,17 +82,16 @@ namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
return leftBound.Y;
|
||||
}
|
||||
else if (xValue > leftBound.X && xValue < rightBound.X)
|
||||
{
|
||||
return MathUtils.Interpolation(xValue, leftBound.X, rightBound.X, leftBound.Y, rightBound.Y);
|
||||
}
|
||||
else if (xValue == rightBound.X)
|
||||
{
|
||||
return rightBound.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MathUtils.Interpolation(xValue, leftBound.X, rightBound.X, leftBound.Y, rightBound.Y);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
//Можно добавить экстраполяцию
|
||||
}
|
||||
public GraphSettings GetGraphSettings()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user