/// <summary> /// Slope of the curve in local coordinates about the local origin that corresponds to the parametric coordinate given. /// </summary> /// <param name="relativePosition">The relative position, s. Relative position must be between 0 and 1.</param> /// <returns>System.Double.</returns> public virtual double SlopeByPosition(double relativePosition) { double xPrime = xPrimeByParameter(relativePosition); double yPrime = yPrimeByParameter(relativePosition); return(GeometryLibrary.SlopeParametric(xPrime, yPrime)); }
/// <summary> /// Slope of the curve in local coordinates about the local origin that corresponds to the parametric coordinate given. /// </summary> /// <param name="angleRadians">Parametric coordinate in radians.</param> /// <returns>System.Double.</returns> public virtual double SlopeByAngle(double angleRadians) { double xPrime = xPrimeByParameter(angleRadians); double yPrime = yPrimeByParameter(angleRadians); return(GeometryLibrary.SlopeParametric(xPrime, yPrime)); }
public static void SlopeParametric_Throws_DivideByZeroException(double xPrime, double yPrime) { Assert.Throws <DivideByZeroException>(() => GeometryLibrary.SlopeParametric(xPrime, yPrime)); }
public static void SlopeParametric(double xPrime, double yPrime, double expected) { double result = GeometryLibrary.SlopeParametric(xPrime, yPrime); Assert.AreEqual(expected, result, Tolerance); }