Logo

Programming-Idioms

History of Idiom 178 > diff from v5 to v6

Edit summary for version 6 by Oldboy:
New Python implementation by user [Oldboy]
ā†·

Version 5

2019-01-24, 13:48:05

Version 6

2019-02-11, 20:04:55

Idiom #178 Check if point is inside rectangle

Set boolean b to true if if the point with coƶrdinates (x,y) is inside the rectangle with coƶrdinates (x1,y1,x2,y2) , or to false otherwise.
Describe if the edges are considered to be inside the rectangle.

Idiom #178 Check if point is inside rectangle

Set boolean b to true if if the point with coƶrdinates (x,y) is inside the rectangle with coƶrdinates (x1,y1,x2,y2) , or to false otherwise.
Describe if the edges are considered to be inside the rectangle.

Code
b = (x1 < x < x2) and (y1 < y < y2)
Comments bubble
Edges NOT considered to be inside.