Cody

# Problem 558. Is the Point in a Triangle?

Solution 2025062

Submitted on 17 Nov 2019 by Le Duc Vu
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 y = 0 Triangle = 0 0 1 1 0 1 1 1 1 Points = 0 0.5000 1.0000 Area_of_Triangle = 0.5000 A1 = 0.2500 A2 = 0.2500 A3 = 0.5000

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 y = 0 Triangle = 0 0 1 1 0 1 1 1 1 Points = 0.8000 0.5000 1.0000 Area_of_Triangle = 0.5000 A1 = 0.2500 A2 = 0.1500 A3 = 0.1000 y = 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 y = 0 0 Triangle = 0.8147 0.9134 1.0000 0.9058 0.6324 1.0000 0.1270 0.0975 1.0000 Points = 0.8000 0.7000 1.0000 0.9000 0.4000 1.0000 Area_of_Triangle = 0.1338 A1 = 0.0118 A2 = 0.0674 A3 = 0.0546 y = 1 0 A1 = 0.0114 A2 = 0.2113 A3 = 0.0889