Cody

Problem 44070. Under the sea: Snell's law & total internal reflection

Solution 3441453

Submitted on 27 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
n_in = 3; n_out = 3; theta_crit_correct = -1; assert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))

t = 1.5708

Assertion failed.

2   Pass
n_in = 1; n_out = 1.333; theta_crit_correct = -1; assert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))

3   Fail
n_in = 1.333; n_out = 1; theta_crit_correct = 49; assert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))

t = 1.5708 - 0.7950i

Assertion failed.

4   Fail
n_in = 4; n_out = 3; theta_crit_correct = 49; assert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))

t = 1.5708 - 0.7954i

Assertion failed.

5   Fail
n_in = 4; n_out = 2; theta_crit_correct = 30; assert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))

t = 1.5708 - 1.3170i

Assertion failed.

Suggested Problems

More from this Author9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!