ScaleXDecorator done
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions.Decorator
|
||||
{
|
||||
public class LimXDecorator : FunctionDecorator
|
||||
{
|
||||
private double leftBound;
|
||||
private double rightBound;
|
||||
public LimXDecorator(IOneVariableFunction function, double leftBound, double rightBound) : base(function)
|
||||
{
|
||||
this.leftBound = leftBound;
|
||||
this.rightBound = rightBound;
|
||||
}
|
||||
public override bool Check()
|
||||
{
|
||||
return base.Check();
|
||||
}
|
||||
public override double GetByX(double xValue)
|
||||
{
|
||||
if (xValue > leftBound && xValue < rightBound)
|
||||
{
|
||||
return base.GetByX(xValue);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions.Decorator
|
||||
{
|
||||
public class ScaleXDecorator : FunctionDecorator
|
||||
{
|
||||
private double factor;
|
||||
public ScaleXDecorator(IOneVariableFunction function, double factor) : base(function)
|
||||
{
|
||||
this.factor = factor;
|
||||
Name = $"{function.Name}, y=f({factor}x)";
|
||||
}
|
||||
public override bool Check()
|
||||
{
|
||||
return base.Check();
|
||||
}
|
||||
public override double GetByX(double xValue)
|
||||
{
|
||||
return base.GetByX(factor * xValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ namespace StructureHelperCommon.Models.Functions
|
||||
public ObservableCollection<IOneVariableFunction> Functions { get; set; } = new ObservableCollection<IOneVariableFunction>();
|
||||
public double MinArg { get; set; }
|
||||
public double MaxArg { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public FormulaFunction(bool isUser = false)
|
||||
{
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public interface ILimitFunction : IFunctionDecorator
|
||||
{
|
||||
public void Limit();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public interface IScaleFunction : IFunctionDecorator
|
||||
{
|
||||
public void Scale();
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace StructureHelperCommon.Models.Functions
|
||||
public ObservableCollection<IOneVariableFunction> Functions { get; set; } = new ObservableCollection<IOneVariableFunction>();
|
||||
public double MinArg { get; set; }
|
||||
public double MaxArg { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public TableFunction(bool isUser = false)
|
||||
{
|
||||
@@ -68,7 +69,9 @@ namespace StructureHelperCommon.Models.Functions
|
||||
|
||||
public double GetByX(double xValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//Реализовать взятие значения из таблицы и интерполяцию по таблице
|
||||
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user