File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
L-B/0023 CircularArc (L-B) Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments