rad2deg function
The resulting angle is calculated by dividing the input angle rad by Math.PI and then multiplying it by 180.
For example, rad2deg(1.5708) returns approximately 90, which is equivalent to pi/2 radians in degrees.
Implementation
@pragma("vm:prefer-inline")
double rad2deg(double rad) {
return rad / Math.PI * 180.0;
}