Cody

# Problem 558. Is the Point in a Triangle?

Solution 1983321

Submitted on 20 Oct 2019 by shaikh akbar shaikh rasul
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 q = 1 2 x = 0 1 1 x1 = 0 1 1 w = 0 0 1 w1 = 0 0 1 a = 0.5000 b = 0 z = 0 0.5000 x = 0 1 1 w = 0.5000 0 1.0000 b = 0.5000 x = 0 1 1 w = 0 0 1 x = 0 0 1 w = 0 0.5000 1.0000 b = 0.7500 x = 0 1 1 w = 0 0 1 x = 0 1 0 w = 0 0 0.5000 b = 1 x = 0 1 1 w = 0 0 1 y = 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 q = 1 2 x = 0 1 1 x1 = 0 1 1 w = 0 0 1 w1 = 0 0 1 a = 0.5000 b = 0 z = 0.8000 0.5000 x = 0.8000 1.0000 1.0000 w = 0.5000 0 1.0000 b = 0.1000 x = 0 1 1 w = 0 0 1 x = 0 0.8000 1.0000 w = 0 0.5000 1.0000 b = 0.2500 x = 0 1 1 w = 0 0 1 x = 0 1.0000 0.8000 w = 0 0 0.5000 b = 0.5000 x = 0 1 1 w = 0 0 1 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 q = 2 2 x = 0.8147 0.9058 0.1270 x1 = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 w1 = 0.9134 0.6324 0.0975 a = 0.1338 b = 0 z = 0.8000 0.7000 x = 0.8000 0.9058 0.1270 w = 0.7000 0.6324 0.0975 b = 0.0546 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 x = 0.8147 0.8000 0.1270 w = 0.9134 0.7000 0.0975 b = 0.1220 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 x = 0.8147 0.9058 0.8000 w = 0.9134 0.6324 0.7000 b = 0.1338 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 z = 0.9000 0.4000 x = 0.9000 0.9058 0.1270 w = 0.4000 0.6324 0.0975 b = 0.2227 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 x = 0.8147 0.9000 0.1270 w = 0.9134 0.4000 0.0975 b = 0.4341 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 x = 0.8147 0.9058 0.9000 w = 0.9134 0.6324 0.4000 b = 0.4455 x = 0.8147 0.9058 0.1270 w = 0.9134 0.6324 0.0975 y = 1 0