Problem 2023. Is this triangle right-angled?
Solution Stats
Problem Comments
-
3 Comments
among a,b,c., specify the hypotenuse.
that's the tricky part here ;) Check all combinations - too bad 'combvec' doesnt work here
Passes for True, but Failing when I get to false test?? Not sure at the moment what I could be missing.
Solution Comments
-
1 Comment
nice
-
3 Comments
tricky
Good problem
good problem
-
1 Comment
A great example!
-
1 Comment
challenging!
-
1 Comment
Yes, I finally got it
-
1 Comment
The 2nd test is incorrect.
-
1 Comment
function flag = isRightAngled(a,b,c)
x=[a b c];
y=sort(x);
flag = y(1)^2+y(2)^2==y(3)^2;
end
-
1 Comment
flag = false;
A = (acos((b^2+c^2-a^2)/(2*b*c)))*180/pi;
B = (acos((a^2+c^2-b^2)/(2*a*c)))*180/pi;
C=180-A-B;
D=[A,B,C];
if any(D==90)
flag = true;
end
-
1 Comment
Creative solution :D
-
1 Comment
good use of sort
-
1 Comment
why is it correct? only because the test case.
a=100, b=20, c=5 will flag true but it not true
-
1 Comment
Without using str2num or regexp
Problem Recent Solvers4439
Suggested Problems
-
80414 Solvers
-
Project Euler: Problem 3, Largest prime factor
1020 Solvers
-
Back to basics 22 - Rotate a matrix
860 Solvers
-
582 Solvers
-
Remove element(s) from cell array
988 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!