deg2rad function

double deg2rad(
  1. double deg
)

Converts an angle in degrees to radians.

The resulting angle is calculated by dividing the input angle deg by 180 and then multiplying it by Math.PI.

For example, deg2rad(90) returns approximately 1.5708, which is equivalent to 90 degrees in radians.

Implementation

@pragma("vm:prefer-inline")
double deg2rad(double deg) {
  return deg / 180.0 * Math.PI;
}