Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Struct: RT.Coordinates.Floret

Summary

Describes a cell in a Floret.Grid. Each floret is a pentagon with one vertex “spikier” than the others. That vertex can be thought of as the center of a hexagon, while the vertex two clockwise from that is a vertex of the same hexagon. The remaining vertices are off from the hexagon’s edge but in such a way that 6 florets make a flower-like shape which tiles the plane in a hexagonal pattern.

Remarks

The “spikier” angles of six pentagons all meet at a vertex, so they must be 60°. The remaining angles are therefore (540 − 60)/4 = 120°.

The shorter side length of the pentagons is 1/√7. The following shows the derivation of this and the point coordinates. This diagram assumes a side length of 1 for the underlying hexagon. The code assumes 3/2, i.e., it scales it up by a factor of 3/2.

ss/2(½, 0)120°xyUsing cosine rule on red triangle:Subtracting first from second equation:Substituting x into the first equation:Left section of red triangle (Pythagoras):Right section of red triangle (Pythagoras):

Constructors

Constructor.
Floret(int q, int r, Floret.Position pos)

Instance methods

bool
Equals(Floret other)
Refer to the documentation for IEquatable<Floret>.Equals.
bool
Equals(object obj)
  • Overrides: object.Equals(object)
Refer to the documentation for object.Equals.
int
  • Overrides: object.GetHashCode()
Refer to the documentation for object.GetHashCode.
string
  • Overrides: object.ToString()
Refer to the documentation for object.ToString.

Static methods

IEnumerable<Floret>
LargeHexagon(int sideLength)
Returns a collection of Floret tiles that form a larger hexagonal structure.

Operators

boolEquality operator.
boolInequality operator.

Instance properties

PointDRefer to the documentation for IHasSvgGeometry.Center.
IEnumerable<Link<Vertex>>Refer to the documentation for IHasSvgGeometry.Edges.
HexThe underlying hex tile. This floret forms one sixth of that hexagon.
IEnumerable<Floret>Refer to the documentation for INeighbor<Floret>.Neighbors.
Floret.PositionWhich of the florets within the hexagon this is.
Vertex[] Returns the vertices along the perimeter of this Floret, going clockwise from the “spiky” vertex (center of Floret.Hex).

Nested types

Describes a grid structure consisting of Floret cells that join up in groups of 6 to form hexagons, which in turn tile the plane.
Identifies one of the Floret cells that make up a hexagon.
Describes one of the vertices of a Floret.