public void ClosestPointOnRayTest(double pointX, double pointY, double rayOriginX, double rayOriginY, double rayDirectionX, double rayDirectionY, double nearestPointX, double nearestPointY) { var point = new Point2D(pointX, pointY); var ray = new Ray2D(new Point2D(rayOriginX, rayOriginY), new Vector2D(rayDirectionX, rayDirectionY)); var closestPoint = ray.ClosestPointOnRay(point); Assert.AreEqual(nearestPointX, closestPoint.X, Helper.E); Assert.AreEqual(nearestPointY, closestPoint.Y, Helper.E); }