Skip to content

API Reference

Geolet provides a collection of geometry primitives for creating diagrams.

Primitives by Category

Category Description
Points Point, Midpoint
Lines & Segments Line, Segment, Triangle, PerpendicularLine, ParallelLine, AngleBisector, Tangent
Circles Circle, CircleWithRadius, CircleThroughPoint
Angles Angle for marking angles
Triangle Centers Centroid, Orthocenter, Circumcenter, Incenter, Incircle, Median, Foot
Intersections Intersection, TangentPoint
Reflections Reflect
Inversions InvertPoint, InvertLine, InvertCircle
Figure & Decorators @figure, @autofigure, Figure

Common Parameters

Most primitives share these parameters:

Styling

Parameter Type Default Description
color str "black" Asymptote color name
style str "solid" Line style: solid, dashed, dotted
width float 1.0 Line width

Labels

Parameter Type Default Description
label str "" Display label (empty = no label)
label_dir str varies Compass direction: N, NE, E, SE, S, SW, W, NW
label_pos float 0.5 Position along path (0.0-1.0) for curves

Type Protocols

Geolet uses protocols for type hints, allowing interoperability between primitives:

  • PointT - Any point-like object
  • LineT - Any infinite line
  • SegmentT - Any line segment
  • CircleT - Any circle
  • TriangleT - Any triangle
  • AngleT - Any angle marking