predicates.locateInRings
This function gives the exact location of the point `(x, y)` against the rings moved by `t = (tx, ty)`. The result has no error: it is the location against the exact moved rings, also when a float sum of a position and `t` rounds.
CLI- Package
- @procedures/predicates · README
- Path
["predicates","locateInRings"]- CLI
mark predicates locateInRings --rings <number[][][]> --x <number> --y <number>- As data
{"$proc":["predicates","locateInRings"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/predicates/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["predicates","locateInRings"], { rings: [], x: 1, y: 1 });
console.log(JSON.stringify(result));From the command line
$ mark predicates locateInRings --rings <number[][][]> --x <number> --y <number>
As data, in a program
{
"$proc": ["predicates", "locateInRings"],
"input": { "rings": [], "x": 1, "y": 1 }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
rings | number[][][] | yes | The rings. Each position has `x` and `y` first. | |
x | number | yes | The x of the point. | |
y | number | yes | The y of the point. | |
tx | number | no | The move of the rings on the x axis. The default is 0. | |
ty | number | no | The move of the rings on the y axis. The default is 0. |
Output
The schema does not list fields ("boundary" | "inside" | "outside").
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"rings": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"description": "The rings. Each position has `x` and `y` first."
},
"x": {
"type": "number",
"description": "The x of the point."
},
"y": {
"type": "number",
"description": "The y of the point."
},
"tx": {
"type": "number",
"description": "The move of the rings on the x axis. The default is 0."
},
"ty": {
"type": "number",
"description": "The move of the rings on the y axis. The default is 0."
}
},
"required": [
"rings",
"x",
"y"
],
"additionalProperties": false
},
"output": {
"type": "string",
"enum": [
"boundary",
"inside",
"outside"
]
}
}