mary revised this gist 4 months ago. Go to revision
1 file changed, 1 insertion, 1 deletion
README.nv
| @@ -1,3 +1,3 @@ | |||
| 1 | - | Historical artifact from 5/25/2025. I was inspired to write it after Wryl posted a `predicates.nv` script. | |
| 1 | + | Historical artifact from 5/25/2025. Adapted from Wryl's `predicates.nv` script. | |
| 2 | 2 | ||
| 3 | 3 | https://discord.com/channels/1292370746017976391/1310739230242242682/1376275575978590268 | |
mary revised this gist 4 months ago. Go to revision
4 files changed, 43 insertions
README.nv(file created)
| @@ -0,0 +1,3 @@ | |||
| 1 | + | Historical artifact from 5/25/2025. I was inspired to write it after Wryl posted a `predicates.nv` script. | |
| 2 | + | ||
| 3 | + | https://discord.com/channels/1292370746017976391/1310739230242242682/1376275575978590268 | |
check-within-bounding-box.nv(file created)
| @@ -0,0 +1,33 @@ | |||
| 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 | |
point-inside-bbox.nv(file created)
| @@ -0,0 +1,4 @@ | |||
| 1 | + | ||
| 2 | + | || | |
| 3 | + | :point: 20 30 | |
| 4 | + | :box: 0 1 88 99 | |
point-outside-bbox.nv(file created)
| @@ -0,0 +1,3 @@ | |||
| 1 | + | || | |
| 2 | + | :point: 20 33333 | |
| 3 | + | :box: 0 1 88 99 | |