hexagonPointsfunction
A hexagon's corners about a centre, pointy at the top, as an SVG points list.
Import it
import { hexagonPoints } from "@johnmorrisdotca/tsunagi/draw";
Definition
function hexagonPoints(x: number, y: number, radius: number): string
Parameters
| Name | Type | Description |
|---|---|---|
x | number | The horizontal point, edge-code or coordinate value specified by this signature. |
y | number | The vertical point, edge-code or coordinate value specified by this signature. |
radius | number | The hexagon radius in drawing units. |
Returns
string
A hexagon's corners about a centre, pointy at the top, as an SVG points list.
Examples
import { hexagonPoints } from "@johnmorrisdotca/tsunagi/draw";
console.log(hexagonPoints(10,10,5));14.33,12.5 10,15 5.67,12.5 5.67,7.5 10,5 14.33,7.5What it prints (run when this page was built)