Logo

Programming-Idioms

History of Idiom 178 > diff from v6 to v7

Edit summary for version 7 by cym13:
New D implementation by user [cym13]
ā†·

Version 6

2019-02-11, 20:04:55

Version 7

2019-03-19, 16:57:26

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
bool b = x1<x && x<x2 && y1<y && y<y2;