Cody

Problem 558. Is the Point in a Triangle?

Solution 1916427

Submitted on 30 Aug 2019 by Adam
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 Px = 0 Py = 0.5000 L = 0.5000 LT1 = 1 LT2 = 1.4142

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 Px = 0.8000 Py = 0.5000 L = 0.9434 LT1 = 1 LT2 = 1.4142

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 Px = 0.8000 Py = 0.7000 L = 0.2139 LT1 = 0.2954 LT2 = 1.0671 Px = 0.9000 Py = 0.4000 L = 0.5204 LT1 = 0.2954 LT2 = 1.0671