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
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15528 Solvers
-
given 3 sides, find area of this triangle
797 Solvers
-
1089 Solvers
-
Create a vector whose elements depend on the previous element
680 Solvers
-
9438 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!