/// <summary> /// Gets the limit by coordinate, if the coordinate lies on the curve. /// </summary> /// <param name="coordinate">The coordinate.</param> /// <param name="curve">The curve.</param> public static CartesianCoordinate GetLimitByCoordinate(CartesianCoordinate coordinate, ICurvePositionCartesian curve) { if (!curve.IsIntersectingCoordinate(coordinate)) { throw new ArgumentOutOfRangeException( $"Coordinate {coordinate} cannot be used as a limit as it does not lie on the curve {curve} provided." ); } return(coordinate); }
/// <summary> /// Gets the limit by the y-coordinate. /// </summary> /// <param name="yCoordinate">The y coordinate.</param> /// <param name="curve">The curve.</param> public static CartesianCoordinate GetLimitByY(double yCoordinate, ICurvePositionCartesian curve) { double xCoordinate = curve.XatY(yCoordinate); return(new CartesianCoordinate(xCoordinate, yCoordinate)); }