Loading files
using System;
using System.Collections.Generic;
namespace IDE.Core.Modeling.Solver.Constraints
{
public class VerticalDistanceToCenterRef : ConstraintRefBase
{
public override double Calc(List<double> parameters)
{
var temp = parameters[P1.Y] - Distance;
return Math.Abs(temp) * 31.62;
}
public override double Grad(List<double> parameters, int index)
{
var temp = parameters[P1.Y] - Distance;
var sign = temp >= 0 ? 1 : -1;
if (index == P1.Y)
return sign * 31.62;// Math.Abs(parameters[P1.Y] - Distance);
return 0;
}
}
}
797882a6aThis file is pinned to the selected release. Download the original to open it in your design tool.