private SamplePoints <double> GetSamplePoints(SMapWorkRequest sMapWorkRequest) { if (Coords.TryGetFromSCoords(sMapWorkRequest.SCoords, out Coords coords)) { double[][] xValueSections = BuildValueSections(coords.LeftBot.X, coords.RightTop.X, sMapWorkRequest.CanvasSize.Width, SECTION_WIDTH, sMapWorkRequest.Area.SectionAnchor.X, sMapWorkRequest.Area.CanvasSize.Width); double[][] yValueSections; if (!coords.IsUpsideDown) { yValueSections = BuildValueSections(coords.RightTop.Y, coords.LeftBot.Y, sMapWorkRequest.CanvasSize.Height, SECTION_HEIGHT, sMapWorkRequest.Area.SectionAnchor.Y, sMapWorkRequest.Area.CanvasSize.Height); } else { yValueSections = BuildValueSections(coords.LeftBot.Y, coords.RightTop.Y, sMapWorkRequest.CanvasSize.Height, SECTION_HEIGHT, sMapWorkRequest.Area.SectionAnchor.Y, sMapWorkRequest.Area.CanvasSize.Height); } return(new SamplePoints <double>(xValueSections, yValueSections)); } else { throw new ArgumentException("Cannot parse the SCoords into a Coords value."); } }