README.nv
· 169 B · Text
Orginalformat
Playground
Historical artifact from 5/25/2025. Adapted from Wryl's `predicates.nv` script.
https://discord.com/channels/1292370746017976391/1310739230242242682/1376275575978590268
1 | Historical artifact from 5/25/2025. Adapted from Wryl's `predicates.nv` script. |
2 | |
3 | https://discord.com/channels/1292370746017976391/1310739230242242682/1376275575978590268 |
check-within-bounding-box.nv
· 618 B · Text
Orginalformat
Playground
| :: check if the point is within a bounding box
:point: $x $y
:box: $x1 $y1 $x2 $y2
|
:: $x >= $x1
:: $y >= $y1
:: $x <= $x2
:: $y <= $y2
:: --------
:: it is inside!
:: --------
:: it is outside.
:: --------
|:: $x >= $y :@math: less| :: false
|:: $x >= $y :@math: $z|
|:: $x >= $y?|
:@math: compare $x $y
|:: $x <= $y :@math: greater| :: false
|:: $x <= $y :@math: $z|
|:: $x <= $y?|
:@math: compare $x $y
|:: false :: --------|
|:: false? :: $1|
|:: false? :: $1 $2|
|:: false? :: $1 $2 $3|
|:: false|
|:: true|
|| :: check if the point is within a bounding box
1 | | :: check if the point is within a bounding box |
2 | :point: $x $y |
3 | :box: $x1 $y1 $x2 $y2 |
4 | | |
5 | :: $x >= $x1 |
6 | :: $y >= $y1 |
7 | :: $x <= $x2 |
8 | :: $y <= $y2 |
9 | :: -------- |
10 | :: it is inside! |
11 | :: -------- |
12 | :: it is outside. |
13 | :: -------- |
14 | |
15 | |:: $x >= $y :@math: less| :: false |
16 | |:: $x >= $y :@math: $z| |
17 | |:: $x >= $y?| |
18 | :@math: compare $x $y |
19 | |
20 | |:: $x <= $y :@math: greater| :: false |
21 | |:: $x <= $y :@math: $z| |
22 | |:: $x <= $y?| |
23 | :@math: compare $x $y |
24 | |
25 | |:: false :: --------| |
26 | |:: false? :: $1| |
27 | |:: false? :: $1 $2| |
28 | |:: false? :: $1 $2 $3| |
29 | |:: false| |
30 | |
31 | |:: true| |
32 | |
33 | || :: check if the point is within a bounding box |
1 | |
2 | || |
3 | :point: 20 30 |
4 | :box: 0 1 88 99 |
5 |
1 | || |
2 | :point: 20 33333 |
3 | :box: 0 1 88 99 |