Advertisement
Guest User

ConvertGradToDegr

a guest
Sep 21st, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. function gradsToDegr(grad) {
  2. let diffDeg = 400 / 360;
  3. let convertGradToDeg = Number(grad) / diffDeg;
  4. convertGradToDeg = convertGradToDeg % 360;
  5.  
  6. if (convertGradToDeg < 0) {
  7. convertGradToDeg += 360;
  8. }
  9. console.log(convertGradToDeg)
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement