Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs =================================================================== diff -u -re128e8c8db744f5cf7336e52e03a4ebfe70a7d69 -r5c7deb47795d2f3c146f6287e7993267e81f3cc9 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision e128e8c8db744f5cf7336e52e03a4ebfe70a7d69) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision 5c7deb47795d2f3c146f6287e7993267e81f3cc9) @@ -332,7 +332,7 @@ grid.NumberOfVerticalPoints); foreach (RoundedDouble interPolatedVerticalPosition in interPolatedVerticalPositions) { - points.AddRange(GetInterPolatedHorizontalPoints(grid.XLeft, + points.AddRange(GetInterpolatedHorizontalPoints(grid.XLeft, grid.XRight, interPolatedVerticalPosition, grid.NumberOfHorizontalPoints)); @@ -479,7 +479,7 @@ } int nrOfInterpolatedPoints = nrOfPoints - 1; - + RoundedDouble deltaZ = endPoint - startPoint; var deltaZBetweenPoints = (RoundedDouble) (deltaZ / nrOfInterpolatedPoints); @@ -522,7 +522,7 @@ && !double.IsNaN(grid.ZBottom); } - private static IEnumerable GetInterPolatedHorizontalPoints(RoundedDouble startPoint, + private static IEnumerable GetInterpolatedHorizontalPoints(RoundedDouble startPoint, RoundedDouble endPoint, RoundedDouble zPoint, int nrOfPoints) @@ -533,17 +533,14 @@ yield break; } - int nrofInterPolatedPoints = nrOfPoints - 1; + int nrOfInterpolatedPoints = nrOfPoints - 1; + RoundedDouble deltaX = endPoint - startPoint; - RoundedDouble deltaXBetweenPoints = nrOfPoints < 2 - ? (RoundedDouble) 0 - : (RoundedDouble) (deltaX / nrofInterPolatedPoints); + var deltaXBetweenPoints = (RoundedDouble) (deltaX / nrOfInterpolatedPoints); RoundedDouble x = startPoint; - int nrOfRepetitions = nrofInterPolatedPoints < 0 - ? 0 - : nrofInterPolatedPoints; - for (var i = 0; i < nrOfRepetitions + 1; i++) + + for (var i = 0; i < nrOfInterpolatedPoints + 1; i++) { yield return new Point2D(x, zPoint); x += deltaXBetweenPoints;