angle

The angle at a vertex, marked with an arc or a right-angle square, and measured.

angleNode
Only withxyargandpolarxyzplane
Two angles drawn from bearings: 60° with its arms and value shown, and a teal reflex sweep of 240° beside it.Two angles drawn from bearings: 60° with its arms and value shown, and a teal reflex sweep of 240° beside it.

An angle marks the corner at a vertex and measures it: angle(at: (1, 1); from: (4, 1); to: (1, 4)). An arm is a point it runs through, (4, 1), or a bearing in degrees anticlockwise from the positive x axis, 30, and the two arms may be written differently. At a right angle the mark is a square, elsewhere an arc; mark: arc or mark: square says which outright. arcs: 2 draws two concentric arcs, the notation for equal angles, and arms draws the arms themselves.

sweep: chooses which way round. minor, the default, is the corner, never more than 180°; reflex is the way round outside it; anticlockwise and clockwise take the arms in the order written, which a sector or a rotation needs. A keyframed arm sweeps round the short way. radius is in pixels, so the mark is the same size whatever the window. In space the corner and arms are points (x, y, z), and the arc is drawn in the plane the arms span.

A right triangle with corners at (0, 0), (4, 0) and (0, 3): the right angle marked at the origin, and the angle θ at (4, 0) with its value drawn.A right triangle with corners at (0, 0), (4, 0) and (0, 3): the right angle marked at the origin, and the angle θ at (4, 0) with its value drawn.
graph{
    polygon(x: 0, 4, 0; y: 0, 0, 3; colour: grey)
    angle#a(at: (0, 0); from: (4, 0); to: (0, 3))
    angle#b(at: (4, 0); from: (0, 0); to: (0, 3); label: $\theta$; show-value)
}
An angle publishes degrees and radians, and show-value draws the reading at the arc. Both are the angle as drawn, so prose citing {{#b.degrees}} agrees with the arc, even while a keyframed arm is moving.

#Attributes

atRequiredImplicitAnimatable
The corner — the point both arms come out of. Animatable as a whole, so !cue.to{(2, 2)} carries the mark to a new vertex in a straight line.
Also written: vertex, originCan be written as shorthand: angle:value
fromRequiredAnimatable
One arm: a point it runs through, (4, 1), or a bearing in degrees anticlockwise from the positive x axis, 30. Either form may be an expression in the environment's parameters. Keyframed, the arm sweeps round to its new direction rather than jumping — and it goes the short way, so an arm asked to move 10° does not travel 350°.
Also written: a, start
toRequiredAnimatable
The other arm, written either of the ways from may be. The two need not agree: from: (4, 1); to: 90 is perfectly good.
Also written: b, end
sweep
Which of the four ways round the arms is meant. minor is the corner — the smaller of the two readings, never more than a straight line, which is what “the angle at that vertex” means everywhere outside a rotation. reflex is the way round outside it. anticlockwise and clockwise take the arms in the order they are written, which is what a sector or a turn needs: 240° anticlockwise is not 120° clockwise.
minorreflexanticlockwiseclockwise
Defaultminor
radiusAnimatable
How big the marker is, in pixels. Furniture, like width and text-size and unlike a circle's radius: an angle mark is the same size on the page whether the plot spans two units or two million.
Default28
markAnimatable
What is drawn at the corner. auto follows the convention every reader was taught with — the square at a right angle, the arc everywhere else. arc and square say it outright: a square on an angle that is not quite 90° is how a diagram states an assumption.
autoarcsquare
Also written: marker
Defaultauto
arcs
Concentric arcs — one, two or three — the notation that marks two angles as equal to each other. Ignored where the marker is the right-angle square, which is marked once or not at all.
Default1
armsAnimatable
Draw the arms themselves: out to the point where one was given, a short ray where a bearing was.
Also written: rays, legs
Defaultfalse
show-valueAnimatable
Draw the measurement, in degrees, at the arc — the protractor reading, live under a parameter, a keyframe and a moving vertex alike. With a label: as well it takes the line below it, so an angle can be named and measured in one place.
Also written: show-measure, measure
Defaultfalse
colourAnimatable
The arc, the wash behind it, the arms and the reading.
paint
Also written: color
Defaultpurple
fillAnimatable
Wash the sector between the arms, behind the arc.
Also written: filled
Defaulttrue
widthAnimatable
Stroke width of the arc, the square and the arms.
Default2
opacityAnimatable
Opacity.
Default1
label
Text drawn just outside the arc, out along the bisector — rich text, so $\theta$ sets as maths. Fades and draws with the element.
hiddenAnimatable
Declared but not drawn. Animatable — hidden: true !cue.to{false}(at: 2) reveals it — and unlike a cue, a hidden element still frames the plot, so the axes do not jump when it appears.
Defaultfalse
lock
Keeps the reader from editing this element on an editable: graph. Nothing at all on a graph that is not editable.
Also written: locked
Defaultfalse
text-sizeAnimatable
Size of the label and the reading.
Default20
layerAnimatable
Paint order among the marks: a higher layer is drawn later, on top; equal or omitted, the marks stack in document order, later on top.
group
The groups this mark belongs to, comma-separated: group: Early sown, Projected. It is drawn in the colour of the first that has one and the stroke of the first the graph's key: gives one, over its own colour: and dashed, and the footer's key names every group.

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

degreesDerived
The angle as drawn, in degrees — the same fact the arc is making, live under a parameter, a keyframed arm and a moving vertex; a dash while an arm points nowhere.
radiansDerived
The same angle in radians, for the documents whose maths is written that way; a dash where degrees is.

#Allowed in

#Examples

The right angle at (1, 1) between the points (4, 1) and (1, 4), marked with a square.The right angle at (1, 1) between the points (4, 1) and (1, 4), marked with a square.
graph{
    angle(at: (1, 1); from: (4, 1); to: (1, 4))
}(
    x-domain: [0, 5]
    y-domain: [0, 5]
)
An angle at (2, 3) marked with two arcs and labelled θ.An angle at (2, 3) marked with two arcs and labelled θ.
graph{
    angle(at: (2, 3); from: (5, 3); to: (2, 6); arcs: 2; label: $\theta$)
}(
    x-domain: [1, 6]
    y-domain: [2, 7]
)
In space: the angle between the vectors (2, 0, 0) and (1, 2, 1) at the origin, drawn in the plane they span, with its arms.In space: the angle between the vectors (2, 0, 0) and (1, 2, 1) at the origin, drawn in the plane they span, with its arms.
graph:xyz{
    vector(dx: 2; dy: 0; dz: 0; colour: blue)
    vector(dx: 1; dy: 2; dz: 1; colour: teal)
    angle#theta(at: (0, 0, 0); from: (2, 0, 0); to: (1, 2, 1); label: $\theta$)
}(
    x domain: [0, 2]
    y domain: [0, 2]
    z domain: [0, 2]
    aspect: equal
)

#Notes

  • Give an angle a node id — angle#theta(…) — and the prose beside the plot can cite its measurement with {{#theta.value}}, which cannot drift from the arc it is describing.

Last updated