Problem 51102. Round the chord length!!
Solution Stats
Problem Comments
-
10 Comments
Hello Fatima Abdullah HCT 2021,
I interpreted circumference y as arclength and computed the length of the chord subtending the angle. I get 0.841 for the first test. Please check the angle in your code. As it is written, it is not dimensionless.
Hello ChrisR!
Just use the chord length formula using trigonometry and then the rounding command. That's it!
I added extra test suite. You can check them.
I have to agree with ChrisR. None of the answers are correct. The first two answers are using the diameter as if it were the radius when calculating the angle. I don't know what the third one has done.
I will give you a hint! go ahead and google Chord Length Using Trigonometry. You will easily answer the question!
Fatima, your solution takes the angle (i.e., half of the angle of the chord) as y/2. If the arclength is y and the radius is x/2, then the full angle is y/(x/2), and half of the angle is y/x.
By "circumference", do you mean the angle measured in radians?
Yes in radians.
@Fatima, mention it in the problem statement as it is quite ambiguous
HI Fatima, I think the correct term is "central angle" instead of circumference.
As I've said in one of your previous problems, Fatima. Human language is imprecise. It would help if you replaced the noun circumference with the noun central angle. It was probably a translation problem; however, if you had drawn a sketch, no one would have had any doubts about what you meant. Or use an example if you don't like to sketch.
Solution Comments
Show commentsProblem Recent Solvers21
Suggested Problems
-
Sum all integers from 1 to 2^n
15688 Solvers
-
Back to basics 4 - Search Path
367 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
828 Solvers
-
8757 Solvers
-
Test if two numbers have the same digits
243 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!