circle
circle()
Draws a circle or ellipse.
Styling
Root: circle
Anchors
Supports border and path anchors. The "center" anchor is the default.
// Draw a circle with center (0, 0)
circle((0, 0))
// Draw an ellipse
circle((2, 0), radius: (1, 0.5))
let (a, b) = ((2, 1), (1, 1))
// Draw a circle with its center at (2, 1), going
// through point (1, 1)
circle(a, b)
// Show both points
set-style(content: (frame: "circle", padding: 1pt, fill: white))
content(a, [A]); content(b, [B])
..points-style:
The position to place the circle on. If given two coordinates, the distance between them is used as radius. If given a single coordinate, the radius can be set via the radius (style) argument.
A number that defines the size of the circle’s radius. Can also be set to a tuple of two numbers to define the radii of an ellipse, the first number is the x radius and the second is the y radius.
circle-through
circle-through()
Draws a circle through three coordinates.
Styling
Root: circle
circle-through has the same styling as circle except for radius as the circle’s radius is calculated by the given coordinates.
Anchors
Supports the same anchors as circle as well as:
- a
- Coordinate a
- b
- Coordinate b
- c
- Coordinate c
let (a, b, c) = ((0, 0), (2, -0.5), (1, 1))
// Draw a circle through 3 points
circle-through(a, b, c, name: "c")
// Show the points
set-style(content: (frame: "circle", padding: 1pt, fill: white))
content(a, [A]); content(b, [B]); content(c, [C])
a:
Coordinate a.
b:
Coordinate b.
c:
Coordinate c.