Generate Thumbnail

Hex grid in SkiaSharp

Concept A hexagon consists of six vertices. Given one vertex coordinate, we can find all other vertices as the angle between two edges is 120 degrees. Consider a starting point (x, y) and the width of an edge b. The right neighbor points will be (x + b, y). The right neighbor of the right neighbor will be (x + b + b * Cos(60), y + b * Sin(60)) and so on. Example ...

August 3, 2024 · 3 min · 634 words · PrashantUnity