Cody

# Problem 45695. How many points lie within the rectangle and how many aren't?

Solution 2636164

Submitted on 30 Jun 2020 by Asif Newaz
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
P =[1 0;1 5;5 5;-1 2;5 -4]; R=[0 0;10 8]; Y_correct =[2 3]; assert(isequal(PointsWithinRectangle(P,R),Y_correct))

2   Pass
P =[1 2;-1 4]; R=[-1 2;3 8]; Y_correct =[0 2]; assert(isequal(PointsWithinRectangle(P,R),Y_correct))

3   Pass
P =[1 0;-4 -5;46 2;8 9;2 3;-2 4;2 -4;6,-6;4 5;1 2;8 9;1 1;0 0;-1 -2;4 5]; R=[-1 4;2 8]; Y_correct =[15 0]; assert(isequal(PointsWithinRectangle(P,R),Y_correct))

4   Pass
P =[1 0;-4 -5;46 2;8 9;2 3;-2 3;2 -4;6,-6;4 5;1 2;-1 2;1 1;0 0;-1 -2;4 5;1 1; 4 2;7 8;1 -1;0 1;2 0]; R=[0 0;10 8]; Y_correct =[9 12]; assert(isequal(PointsWithinRectangle(P,R),Y_correct))

5   Pass
P =[11 0;-4 -5;46 2;8 9;2 3;-2 3;2 -4;6,-6;4 5;1 2;-1 2;1 1;0 0;-1 -2;4 5;1 1; 4 2;7 8;1 -1;0 1;22 0]; R=[0 0;10 8]; Y_correct =[11 10]; assert(isequal(PointsWithinRectangle(P,R),Y_correct))