Classify a point by checking it against the four bounds of a clipping rectangle.

Example

Classify a point against four clipping bounds.

highlighted = computed this step

Step 1 — Set up

Set up the exact input values.

rect and point({’xmin’: Fraction(1, 1), ’xmax’: Fraction(5, 1), ’ymin’: Fraction(1, 1), ’ymax’: Fraction(4, 1)}, (3, 2))\begin{array}{c|c}\text{rect and point}&\text{(\{'xmin': Fraction(1, 1), 'xmax': Fraction(5, 1), 'ymin': Fraction(1, 1), 'ymax': Fraction(4, 1)\}, (3, 2))}\end{array}
Point in rectangleThe point is checked against all four bounds.P

Step 2 — x bounds

Compute the highlighted value.

xmin <= x <= xmax(True, True)\begin{array}{c|c}\text{xmin <= x <= xmax}&\hlmath{\text{(True, True)}}\end{array}
Point in rectangleThe point is checked against all four bounds.P

Step 3 — y bounds

Compute the highlighted value.

ymin <= y <= ymax(True, True)\begin{array}{c|c}\text{ymin <= y <= ymax}&\hlmath{\text{(True, True)}}\end{array}
Point in rectangleThe point is checked against all four bounds.P

Step 4 — Result

State the structural verdict.

verdictinside\begin{array}{c|c}\text{verdict}&\hlmath{\text{inside}}\end{array}
Point in rectangleThe point is checked against all four bounds.P
point-in-rectangle A point is inside a rectangular viewport only when its x and y coordinates both stay within the rectangle's min and max bounds.