public void SealInterp(InterpXY interp) { MyDiff = null; IsNeedSynch = true; Action <double> old = new Action <double>(SetVal); SetVal = t => old(interp.GetV(t)); }
public void InerpolMethodLineTest() { sInterp1elem.InterpType = InterpolType.itLine; Assert.AreEqual(3.0, sInterp1elem.GetV(3)); sInterp2elem.InterpType = InterpolType.itLine; Assert.AreEqual(1.0, sInterp2elem.GetV(1)); Assert.AreEqual(3.0, sInterp2elem.GetV(3)); Assert.AreEqual(4.0, sInterp2elem.GetV(4)); sInterp5elem.InterpType = InterpolType.itLine; Assert.AreEqual(-2.0, sInterp5elem.GetV(-1)); Assert.AreEqual(-0.2, sInterp5elem.GetV(-0.1), 0.0001); Assert.AreEqual(2.2, sInterp5elem.GetV(6), 0.0001); Assert.AreEqual(0.0, sInterp5elem.GetV(3)); Assert.AreEqual(-0.5, sInterp5elem.GetV(2), 0.0001); Assert.AreEqual(7.0, sInterp5elem.GetV(10)); }
public double Get_kt_I_shtr(double mach, double alpha) { double lmbda_nos; if (Body.Nose is RocketNos_ConePlusCyl) { lmbda_nos = Body.Lmb_nos; } else { double cx_nos = Body.Cx_nose(mach); InterpXY lmb_ot_Cx = new InterpXY(); foreach (var item in (AeroGr.Graphs["4_11"] as Interp2D)._data) { double lmb = item.Key; double cx_tmp = item.Value.GetV(mach); lmb_ot_Cx.Add(cx_tmp, lmb); } lmbda_nos = lmb_ot_Cx.GetV(cx_nos); } return(AeroGr.GetV("3_21", lmbda_nos, mach)); }