Problem 164. Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: http://en.wikipedia.org/wiki/Right_triangle.
Examples:
[3 4 5] ---> true
[5 12 13] ---> true
[5 5 5] ---> false
Solution Stats
Problem Comments
-
3 Comments
Nikolaos Nikolaou
on 15 Nov 2017
how is [5 5 5] false?
the cyclist
on 16 Nov 2017
@Nikolaos
[5 5 5] can make a triangle, but not a *right* triangle (with one 90-degree angle). See the Wikipedia page definition.
Sneha
on 17 Jul 2023
Great!
Solution Comments
Show commentsProblem Recent Solvers1412
Suggested Problems
-
Swap the first and last columns
21533 Solvers
-
Determine Whether an array is empty
790 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
841 Solvers
-
583 Solvers
-
Matlab Basics - Convert a row vector to a column vector
648 Solvers
More from this Author23
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!