exercises/ex05/shapes_soln.c
int point_in_rect(Point *p, Rectangle *rect) {
    double x = rect->corner->x;
    double y = rect->corner->y;

    if (p->x < x) return 0;
    if (p->y < y) return 0;
    if (p->x > x + rect->width) return 0;
    if (p->y > y + rect->height) return 0;

    return 1;
}
/* Check whether a point is inside a rectangle.

The corner indicates the lower-left corner, and the positive-y axis is up.

On the line is in.

returns: 1 if the point is in the rectangle, else 0
*/
Check whether a point is inside a rectangle.
The corner indicates the lower-left corner, and the positive-y axis is up.

On the line is in.

1 if the point is in the rectangle, else 0
Check whether a point is inside a rectangle . The corner indicates the lower - left corner and the positive - y axis is up . On the line is in . 1 if the point is in the rectangle else 0
int point_in_rect(Point *p, Rectangle *rect) {
    double x = rect->corner->x;
    double y = rect->corner->y;
    if (p->x < x) return 0;
    if (p->y < y) return 0;
    if (p->x > x + rect->width) return 0;
    if (p->y > y + rect->height) return 0;
    return 1;
}
int point_in_rect ( Point * p , Rectangle * rect ) { double x = rect -> corner -> x ; double y = rect -> corner -> y ; if ( p -> x < x ) return 0 ; if ( p -> y < y ) return 0 ; if ( p -> x > x + rect -> width ) return 0 ; if ( p -> y > y + rect -> height ) return 0 ; return 1 ; }
Check whether a point is inside a rectangle.
Check whether a point is inside a rectangle .