public double CalculateValue(SlabModelImpl aSlabModel) { if (aSlabModel == null) { throw new ArgumentNullException("aSlabModel"); } // вычисляем середину слитка. var indent = 150.0; // 15 см. var coordinateY = (aSlabModel.GetBottomLimit() + aSlabModel.GetTopLimit())/2; var leftPoint = aSlabModel.GetRightSidePoint(coordinateY, indent); var rightPoint = aSlabModel.GetRightSidePoint(coordinateY, aSlabModel.GetLengthLimit() - indent); var middlePoint = aSlabModel.GetRightSidePoint(coordinateY, aSlabModel.GetLengthLimit()/2); return Math.Round(middlePoint.DistanceToLine(leftPoint, rightPoint), 4); }
public double CalculateValue(SlabModelImpl aSlabModel) { if (aSlabModel == null) { throw new ArgumentNullException("aSlabModel"); } // вычисляем середину слитка. var positionY = 0.5 * (aSlabModel.GetTopLimit() + aSlabModel.GetBottomLimit()); //var positionY = 0; // отступаем 10 см от торца слитка. var positionZ = 100; var leftPoint = aSlabModel.GetLeftSidePoint(positionY, positionZ); var rightPoint = aSlabModel.GetRightSidePoint(positionY, positionZ); var width = Math.Round(rightPoint.X - leftPoint.X, 4); return width; }