Cody

# Problem 558. Is the Point in a Triangle?

Solution 1809066

Submitted on 7 May 2019 by Beatriz Orozco
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
Triangle = [0, 0; 1, 0; 1, 1]; Points = [0, 0.5] y_correct = 0; assert(isequal(your_fcn_name(Points,Triangle),y_correct))

Points = 0 0.5000 x = 0 1 1 y = 0 0 1 z = [] xp = 0 yp = 0.5000 A = 1 1 0 1 B = 0 0.5000 t = -0.5000 0.5000 z = 0

2   Pass
Triangle = [0, 0; 1, 0; 1, 1]; Points = [0.8, 0.5] y_correct = 1; assert(isequal(your_fcn_name(Points,Triangle),y_correct))

Points = 0.8000 0.5000 x = 0 1 1 y = 0 0 1 z = [] xp = 0.8000 yp = 0.5000 A = 1 1 0 1 B = 0.8000 0.5000 t = 0.3000 0.5000 z = 1

3   Pass
Triangle = [0.8147, 0.9134; 0.9058, 0.6324; 0.1270, 0.0975]; Points = [0.8, 0.7; 0.9, 0.4] y_correct = [1 0]; assert(isequal(your_fcn_name(Points,Triangle),y_correct))

Points = 0.8000 0.7000 0.9000 0.4000 x = 0.8147 0.9058 0.1270 y = 0.9134 0.6324 0.0975 z = [] xp = 0.8000 0.9000 yp = 0.7000 0.4000 A = 0.0911 -0.6877 -0.2810 -0.8159 B = -0.0147 -0.2134 t = 0.5036 0.0881 z = 1 A = 0.0911 -0.6877 -0.2810 -0.8159 B = 0.0853 -0.5134 t = 1.5796 0.0852 z = 1 0