Cody

Problem 45278. Orthogonal lines

Solution 2194361

Submitted on 5 Apr 2020 by Martin C.
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   Pass
p=[7,3;0 13]; q=[2,0;-1,0]; y_correct = 0; assert(isequal(ortho_line(p,q),y_correct))

P = 7 -10 Q = 3 0 tf = logical 0

2   Pass
p=[0,3;0 13]; q=[2,0;-1,0]; y_correct = 1; assert(isequal(ortho_line(p,q),y_correct))

P = 0 -10 Q = 3 0 tf = logical 1

3   Pass
p=[0,4;0 -9]; q=[2,3;-1,0]; y_correct = 0; assert(isequal(ortho_line(p,q),y_correct))

P = 0 13 Q = 3 3 tf = logical 0

4   Pass
p=[0,4;0 -9]; q=[2,0;-1,0]; y_correct = 1; assert(isequal(ortho_line(p,q),y_correct))

P = 0 13 Q = 3 0 tf = logical 1

5   Pass
p=[2,2;5,5]; q=[0,-2;-2,0]; y_correct = 1; assert(isequal(ortho_line(p,q),y_correct))

P = -3 -3 Q = 2 -2 tf = logical 1

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!