2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: sitsOn()
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
bool point.sitsOn(Point check)
|
|
|
|
```
|
|
|
|
|
|
|
|
Returns true if the point has the same coordinates as the one you pass to it.
|
|
|
|
|
|
|
|
<Example
|
2021-10-17 18:26:00 +02:00
|
|
|
part="point_sitson"
|
|
|
|
caption="An example of the Point.sitsOn() method"
|
2021-08-25 16:09:31 +02:00
|
|
|
/>
|
|
|
|
|
|
|
|
```js
|
|
|
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
|
|
|
|
|
|
|
let s;
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
points[`a${i}`] = new Point(i * 10, 40);
|
|
|
|
points[`b${i}`] = new Point(i * 10, i * 8);
|
|
|
|
if (points[`a${i}`].sitsOn(points[`b${i}`])) s = "notch";
|
|
|
|
else s = "bnotch";
|
|
|
|
snippets[`b${i}`] = new Snippet(s, points[`b${i}`]);
|
|
|
|
snippets[`a${i}`] = new Snippet(s, points[`a${i}`]);
|
|
|
|
}
|
|
|
|
```
|