This language bar is your friend. Select your favorite languages!

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.

bool b = x1<x && x<x2 && y1<y && y<y2;
const pointInRect = ({x1, y1, x2, y2}, {x, y}) => (
  (x > x1 && x < x2) && (y > y1 && y < y2)
b := PtInRect(Rect(x1,y1,x2,y2), Point(x,y));
b = (x1 < x < x2) and (y1 < y < y2)
Point =, :y)

Rect  =, :y1, :x2, :y2) do
  def contains?(point)
    point.x.between?(x1,x2) && point.y.between?(y1,y2)

b =,0,2,5).contains?(,0))

Do you know the best way to do this in your language ?
New implementation...

Idiom created by