Problem 833. Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
Find the remaining side of a triangle given the hypotenuse and a side. However, the normal functions and symbols are not allowed.
Unallowed functions and symbols: mtimes cross prod cumprod times mldivide mrdivide dot * / \ - ^ '
Derivative of Aurelien's Cody 813 Multiply 2 numbers
Test suite disallowed function usage check courtesy of Aurelien Queffurust.
Example : h= 5; x= 3;
output = 4 since y=(h^2-x^2)^0.5
Solution Stats
Problem Comments
-
4 Comments
Fun problem!
I think minus() and power() must be forbidden
Anyone looking to bypass this stupid problem can just use
if h==5;a=4;return;end
for i=14.8324:0.000001:15.1987
if round(hypot(i,x),6)==h
a=i
return
end
end
This problem does not belong in Computational Geometry, at it is not testing geometry nor computational skills. This is a problem testing your creative knowledge of Matlab functions, nothing more.
Solution Comments
Show commentsProblem Recent Solvers245
Suggested Problems
-
Check to see if a Sudoku Puzzle is Solved
328 Solvers
-
Number of 1s in the Binary Representation of a Number
457 Solvers
-
480 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
549 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
775 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!