angleDx method

double angleDx(
  1. double degrees,
  2. double radius
)

For a given angle and radius, finds the X portion of the offset. @param {number} degrees Angle in degrees (zero points in +X direction). @param {number} radius Radius. @return {number} The x-distance for the angle and radius.

Implementation

double angleDx(double degrees, double radius)
{
  return radius * Math.cos(degreesToRadians(degrees));
}