Skip to content

Commit c3635d8

Browse files
authored
Merge pull request #50 from paternostrox/paternostro-branch
Added Circular Arc Problem
2 parents 9f04ad8 + 7a25c68 commit c3635d8

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function CircularArc(r, theta) {
2+
let thetaRad = theta * (Math.PI / 180);
3+
return thetaRad * r;
4+
}
5+
6+
CircularArc(10, 45); // Change these numbers
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# CircularArc
2+
3+
## Problem
4+
Write a function that takes a radius 'r' and a angle 'theta' in DEGREES and returns the length of the circular arc.
5+
6+
## Solution
7+
8+
```javascript
9+
function CircularArc(r, theta) {
10+
let thetaRad = theta * (Math.PI / 180);
11+
return thetaRad * r;
12+
}
13+
```
14+
15+
## How it works
16+
- First we convert the angle from degrees to radians.
17+
- Then we calculate the arc based on the angle in radians using the arc formula.
18+
19+
20+
## References
21+
- [Wikipedia](https://en.wikipedia.org/wiki/Circular_arc)
22+
- [GoLinuxCloud](https://www.golinuxcloud.com/mathtoradians-javascript/)
23+
24+
## Problem Added By
25+
Same as reference, use your any social links
26+
- [GitHub](https://github.com/paternostrox)
27+
- [LinkedIn](https://www.linkedin.com/in/paternostrox)
28+
29+
30+
## Contributing
31+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
32+
33+
Please make sure to update tests as appropriate.

0 commit comments

Comments
 (0)