diff --git a/src/Vts/MonteCarlo/Helpers/CylinderTissueRegionToolbox.cs b/src/Vts/MonteCarlo/Helpers/CylinderTissueRegionToolbox.cs index 28f856ed..e354ed2e 100644 --- a/src/Vts/MonteCarlo/Helpers/CylinderTissueRegionToolbox.cs +++ b/src/Vts/MonteCarlo/Helpers/CylinderTissueRegionToolbox.cs @@ -115,11 +115,10 @@ public static bool RayIntersectInfiniteCylinder(Position p1, Position p2, bool o return true; + default: // roots imaginary -> no intersection + return false; } /* end switch */ - /* bb-4ac>0 */ - /* roots imaginary -> no intersection */ - return false; } } } diff --git a/src/Vts/MonteCarlo/Tissues/SingleInclusionTissue.cs b/src/Vts/MonteCarlo/Tissues/SingleInclusionTissue.cs index 9874a400..dedd6f7f 100644 --- a/src/Vts/MonteCarlo/Tissues/SingleInclusionTissue.cs +++ b/src/Vts/MonteCarlo/Tissues/SingleInclusionTissue.cs @@ -93,8 +93,7 @@ public override double GetDistanceToBoundary(Photon photon) if ((regionIndex != _layerRegionIndexOfInclusion) && (regionIndex != _inclusionRegionIndex)) return base.GetDistanceToBoundary(photon); // check if current track will hit the inclusion boundary, returning the correct distance - double distanceToBoundary; - if (_inclusionRegion.RayIntersectBoundary(photon, out distanceToBoundary)) + if (_inclusionRegion.RayIntersectBoundary(photon, out var distanceToBoundary)) { return distanceToBoundary; }