Design & Download
Your JS Library
in Seconds!!!

Snippet: Degree & Radian Converters

Written by Christopher West (cwest) on January 12, 2016.
Convert degrees to radians and radians to degrees.
function degrees(radians) {
  return radians * 180 / Math.PI;

function radians(degrees) {
  return degrees * Math.PI / 180;

degrees(...) API Documentation

Converts radians to degrees.


  1. radians {number}:
    The number representing radians of in angle which will be converted to degrees.


The equivalent of radians in degrees.

radians(...) API Documentation

Converts degrees to radians.


  1. degrees {number}:
    The number representing degrees of in angle which will be converted to radians.


The equivalent of degrees in radians.