public static void Cos(double degrees, double expectedResult) { double radians = Angle.DegreesToRadians(degrees); Assert.AreEqual(expectedResult, TrigonometryLibrary.Cos(radians), Tolerance); }
/// <summary> /// X-coordinate on 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></returns> public override double XbyRotationAboutOrigin(double angleRadians) { return(DistanceFromVertexMajorToLocalOrigin * TrigonometryLibrary.Cos(angleRadians)); }
/// <summary> /// X-coordinate on the curve in local coordinates about the left (-X) focus that corresponds to the parametric coordinate given. /// </summary> /// <param name="angleRadians">Angle of rotation about the left (-X) focus, in radians.</param> /// <returns></returns> public override double XbyRotationAboutFocusLeft(double angleRadians) { return(-1 * DistanceFromFocusToLocalOrigin + RadiusAboutFocusLeft(angleRadians) * TrigonometryLibrary.Cos(angleRadians)); }
/// <summary> /// Primes the by angle. /// </summary> /// <param name="angleRadians">The angle radians.</param> /// <returns>System.Double.</returns> public override double PrimeByParameter(double angleRadians) { return(_parent.RadiusAboutFocusRight((Coordinates.Angle)angleRadians) * TrigonometryLibrary.Cos(angleRadians)); }
/// <summary> /// Primes the double by angle. /// </summary> /// <param name="angleRadians">The angle radians.</param> /// <returns>System.Double.</returns> public override double PrimeDoubleByParameter(double angleRadians) { return(-1 * _parent.DistanceFromVertexMajorToLocalOrigin * TrigonometryLibrary.Cos(angleRadians)); }
/// <summary> /// X-coordinate on the curve in local coordinates about the focus that corresponds to the parametric coordinate given. /// </summary> /// <param name="angleRadians">Angle of rotation about the focus, in radians.</param> /// <returns></returns> public override double BaseByParameter(double angleRadians) { return(_parent.DistanceFromVertexMajorToLocalOrigin - _parent.RadiusAboutFocusRight((Coordinates.Angle)angleRadians) * TrigonometryLibrary.Cos(angleRadians)); }
/// <summary> /// The radius measured from the left (-X) major vertex as a function of the angle in local coordinates. /// </summary> /// <param name="angleRadians">The angle in radians in local coordinates.</param> /// <returns>System.Double.</returns> public override double RadiusAboutVertexMajorLeft(double angleRadians) { double radius = 2 * Radius * TrigonometryLibrary.Cos(angleRadians); return(radius.IsPositiveSign(Tolerance)? radius: 0); }
/// <summary> /// Primes the by angle. /// </summary> /// <param name="angleRadians">The angle radians.</param> /// <returns>System.Double.</returns> public override double PrimeByParameter(double angleRadians) { return(_parent.DistanceFromVertexMinorToMajorAxis * TrigonometryLibrary.Cos(angleRadians)); }