66 * @see https://en.wikipedia.org/wiki/Degree_(angle)
77 * @example degreesToRadians(45) = 0.7853981633974483
88 */
9- function degreesToRadians ( degrees ) {
10- return angle = degrees * Math . PI / 180
11- }
9+ function degreesToRadians ( degrees ) {
10+ return degrees * Math . PI / 180
11+ }
1212
13- /**
14- * @function circularArcLength
15- * @description calculate the length of a circular arc
16- * @param {Integer } radius
17- * @param {Integer } degrees
18- * @returns {Integer } radius * angle_in _adians
19- * @see https://en.wikipedia.org/wiki/Circular_arc
20- * @example circularArcLength(3, 45) = 2.356194490192345
21- */
22- function circularArcLength ( radius , degrees ) {
23- return length = radius * degreesToRadians ( degrees )
24- }
25- /**
26- * @function circularArcArea
27- * @description calculate the area of the sector formed by an arc
28- * @param {Integer } radius
29- * @param {Integer } degrees
30- * @returns {Integer } 0.5 * r * r * angle_in_radians
31- * @see https://en.wikipedia.org/wiki/Circular_arc
32- * @example circularArcArea(3,45) = 3.5342917352885173
33- */
34- function circularArcArea ( radius , degrees ) {
35- return area = Math . pow ( radius , 2 ) * degreesToRadians ( degrees ) / 2
36- }
13+ /**
14+ * @function circularArcLength
15+ * @description calculate the length of a circular arc
16+ * @param {Integer } radius
17+ * @param {Integer } degrees
18+ * @returns {Integer } radius * angle_in _adians
19+ * @see https://en.wikipedia.org/wiki/Circular_arc
20+ * @example circularArcLength(3, 45) = 2.356194490192345
21+ */
22+ function circularArcLength ( radius , degrees ) {
23+ return radius * degreesToRadians ( degrees )
24+ }
25+ /**
26+ * @function circularArcArea
27+ * @description calculate the area of the sector formed by an arc
28+ * @param {Integer } radius
29+ * @param {Integer } degrees
30+ * @returns {Integer } 0.5 * r * r * angle_in_radians
31+ * @see https://en.wikipedia.org/wiki/Circular_arc
32+ * @example circularArcArea(3,45) = 3.5342917352885173
33+ */
34+ function circularArcArea ( radius , degrees ) {
35+ return Math . pow ( radius , 2 ) * degreesToRadians ( degrees ) / 2
36+ }
3737
38- export {
38+ export {
3939 circularArcLength ,
4040 circularArcArea
41- }
41+ }
0 commit comments