Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Struct: RT.Coordinates.Cairo

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)

Constructors

Constructor.
Cairo(int x, int y, Cairo.Position pos)
Constructor.

Instance methods

bool
Equals(Cairo other)
Refer to the documentation for IEquatable<Cairo>.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<Cairo>
Rectangle(int width, int height)
Constructs a grid of the specified width and height and divides each square into four Cairo cells.

Operators

boolEquality operator.
boolInequality operator.

Instance properties

SquareIdentifies a square. Each cairo forms one quarter of this square.
PointDRefer to the documentation for IHasSvgGeometry.Center.
IEnumerable<Link<Vertex>>Refer to the documentation for IHasSvgGeometry.Edges.
IEnumerable<Cairo>Refer to the documentation for INeighbor<Cairo>.Neighbors.
Cairo.PositionIdentifies which cairo within Cairo.Cell this is.
Vertex[] Returns the vertices along the perimeter of this Cairo, going clockwise from the vertex at the center of Cairo.Cell.

Nested types

Describes a grid structure consisting of Cairo cells that join up in groups of 4 to form a pattern that tiles the plane.
Identifies one of the Cairo cells that make up a square.
Describes one of the vertices of a Cairo.