8000 Merge pull request #17 from nzwnabdulwahid/DegreeRadian · AllAlgorithms/javascript@7d88f45 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d88f45

Browse files
authored
Merge pull request #17 from nzwnabdulwahid/DegreeRadian
Degree Radian Conversion
2 parents 68ad56e + aa61a10 commit 7d88f45

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

math/degreeRadianConversion.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// JavaScript implementation of Degree-Radian Conversion
2+
3+
// Author: Niezwan Abdul Wahid
4+
5+
function degreeToRadian(degree) {
6+
return degree * (Math.PI / 180);
7+
}
8+
9+
function radianToDegree(radian) {
10+
return radian * (180 / Math.PI);
11+
}
12+
13+
14+
//degreeToRadian(180) === 3.1415926
15+
16+
//radianToDegree(3.1415) === 179.994

0 commit comments

Comments
 (0)
0