Problem 198. Are you in or are you out?

Created by the cyclist in Community

Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the point lies inside (or on the boundary) of the polygon defined by the vertices.


 % The specified point is the center of the unit square:
 xv = [0 1 1 0];
 yv = [0 0 1 1];
 X = 0.5;
 Y = 0.5;
 inside(xv,yv,X,Y) -----> true

Solution Stats

58.27% Correct | 41.73% Incorrect
Last solution submitted on May 17, 2019

Problem Comments

Recent Solvers134

Suggested Problems

More from this Author23