They convert between degrees and radians. Some math functions like sin() and cos() expect the value to be in radians. I don’t know how they work only that they convert between the 2 formats.
I’ve been using some ToRad in a project.
I have my player object and a crosshair a certain distance away. ToRad comes in handy to get the X and Y coordinates to keep the crosshair positioned based on the angle of where the player is facing and the distance that’s been set.
The formula I’m using goes like this:
Player.X() + (cos(ToRad(Player.Angle()))) * ([distance variable]))
Player.Y() + (sin(ToRad(Player.Angle()))) * ([distance variable])