Skip to content

Commit

Permalink
docs: fix typo in polygonCentroid example (#3844)
Browse files Browse the repository at this point in the history
The example under the `polygonCentroid` heading was calling `polygonArea`.
  • Loading branch information
aqandrew committed Apr 25, 2024
1 parent 2984f0b commit 9bc8563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/d3-polygon.md
Expand Up @@ -24,7 +24,7 @@ d3.polygonArea([[1, 1], [1.5, 0], [2, 1]]) // -0.5
## polygonCentroid(*polygon*) {#polygonCentroid}

```js
d3.polygonArea([[1, 1], [1.5, 0], [2, 1]]) // [1.5, 0.6666666666666666]
d3.polygonCentroid([[1, 1], [1.5, 0], [2, 1]]) // [1.5, 0.6666666666666666]
```

[Source](https://github.com/d3/d3-polygon/blob/main/src/centroid.js) · Returns the [centroid](https://en.wikipedia.org/wiki/Centroid) of the specified *polygon*.
Expand Down

0 comments on commit 9bc8563

Please sign in to comment.