angle

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

angleNode
Only withxyargandpolarxyzplane
On this page
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.
Also written: vertex, originCan be written as shorthand: angle:value
fromRequiredAnimatable
One arm, as a point it runs through or a bearing in degrees anticlockwise from the positive x axis.
Also written: a, start
toRequiredAnimatable
The other arm, written either of the ways from may be.
Also written: b, end
sweep
Which of the four ways round the arms is meant.
minorreflexanticlockwiseclockwise
Defaultminor
radiusAnimatable
The marker's size in pixels, the same whatever the plot's units.
Default28
markAnimatable
What is drawn at the corner.
autoarcsquare
Also written: marker
Defaultauto
arcs
The number of concentric arcs, marking angles as equal to each other.
Default1
armsAnimatable
Whether the arms themselves are drawn.
Also written: rays, legs
Defaultfalse
show-valueAnimatable
Whether the measurement in degrees is drawn at the arc.
Also written: show-measure, measure
Defaultfalse
colourAnimatable
The colour of the arc, the wash behind it, the arms and the reading.
paint
Also written: color
Defaultpurple
fill-styleAnimatable
How the sector between the arms is filled.
solidhatcheddottedoutlined
Defaultsolid
stroke-styleAnimatable
How the arc is drawn.
soliddasheddotted
Defaultsolid
widthAnimatable
The stroke width of the arc, the square and the arms.
Default2
opacityAnimatable
How opaque the angle is.
Default1
label
Text drawn just outside the arc, along the bisector.
content
hiddenAnimatable
Declared but not drawn; a hidden angle still frames the plot.
Defaultfalse
lock
Keeps the reader from editing this angle on an editable: graph.
Also written: locked
Defaultfalse
text-sizeAnimatable
The size of the label and the reading.
Default20
layerAnimatable
Paint order among the marks; a higher layer is drawn on top.
group
The groups this mark belongs to, comma-separated.

#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; a dash while an arm points nowhere.
radiansDerived
The angle in radians; a dash where degrees is.

#Allowed content

label: { }Any block node

#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