Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0de33fa

Browse files
Updated to follow Javascript Standard Style
1 parent 49dd1eb commit 0de33fa

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

‎Maths/CircularArc.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /