Exemplo n.º 1
0
        public static CurvePoint Solve(this Interpolation interpolation, CurvePoint a, CurvePoint b, Maturity maturity)
        {
            if (a.Price.Currency != b.Price.Currency)
            {
                throw new NotImplementedException("Converting between currencies is not supported");
            }

            var pointA = a.ToPoint();
            var pointB = b.ToPoint();
            var x      = maturity.ToX();

            var point = interpolation.SolveForY(pointA, pointB, x);

            return(CurvePoint.FromPoint(point, a.Price.Currency));
        }