Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Constructor: Cairo(Square, Cairo.Position)

  • Declared in: RT.Coordinates.Cairo

Declaration

public Cairo(
    Square cell,
    Cairo.Position pos
)

Summary

Represents a cell in a Cairo.Grid. The gridlines form an interlocking pattern of perpendicular stretched hexagons. Each cairo is an irregular pentagon, one vertex of which can be thought of as the center of a square, while the vertex two clockwise from that is a vertex of the same square. The remaining vertices are off from the square’s edge but in such a way that 4 cairos make a flower-like shape which tiles the plane in a rectilinear pattern.

Remarks

The length of each side of the pentagons is √2 (√7 − 1)/3, or about .7758146. The inner angles of each pentagon are: 2π − 2arccos((1 − √(7))/4) (apex; about 131.409°), 90°, arccos((1 − √(7))/4) (about 114.296°), arccos((1 − √(7))/4) again, and 90° again.

The following shows the derivation of these quantities and the point coordinates. This diagram assumes a side length of 1 for the underlying square. The code assumes 2, i.e., it scales it up by a factor of 2.

s/2(0, 0)(1/2, 1/2)ss360°−2α√2/2α−90°(1/2, 0)−s cos αα√2/2 + 2s cos αα(y, x)Using cosine rule on red triangle:Using equality of the green lines:Combining both expressions for cos α:Substituting into the second equation for cos α:Left section of red triangle (Pythagoras):Right section of red triangle (Pythagoras):Subtracting first from second equation:Substituting x into the first equation:xy(y/2+¼, x/2)