Problem 198. Are you in or are you out?

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.

Example:

 % 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

52.39% Correct | 47.61% Incorrect
Last Solution submitted on Mar 16, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers229

Suggested Problems

More from this Author23

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!