contour
The level sets of a function of the plane.
contourxyargandpolarxyzplaneOn this page


A contour draws the level sets of a function of the plane, the same expression a surface takes, sampled over the visible window and again as the reader pans: contour(f: x^2 + y^2; levels: 1, 4, 9). levels: gives the values exactly, one curve each, and its entries may be parameters, levels: k, 2 * k. Without it, level-count: asks for about that many, 12 unless written, at round values the way ticks are chosen. In the expression the plane's coordinates are axes, not parameters: only the other letters get footer sliders, and moving one moves the levels live.
Under multicolour, the default, each level is drawn in the colour of its own value, violet low to red high; temperature runs blue through white to red; a hue draws every level alike. The colours span the values in the window, or the window colour: #self.value -> -1..1 -> temperature pins, which holds them still as a parameter moves. A map paints each level flat in the colour of the band its value falls in: colour: #self.value -> (..<0: blue; 0..: red). Over a surface of the same expression the levels trace the wash. In space they are drawn on the floor of the box, or on the surface at their own heights with on: surface.
#Attributes
expressioncontour(f: (x - 2)^2 + (y - 3)^2); r and theta on the polar plane; z on the argand plane. In space, a height z = f(x, y).exp, f, func, functionCan be written as shorthand: contour:valuelevel-countlevels: names them.12levelslevel-count:, for surfaces whose structure even spacing misrepresents — a quadratic bowl wants 1, 4, 9, 16. Entries are parametised: at: k, 2 * k, 4 * k rides a parameter slider. One entry is one curve: levels: 0.onfloor (the default) maps them on the floor of the box under the surface; surface draws each on the surface at its own height. Space only.floorsurfacefloorcolour#self.value, each level's value, pins the window so a level's colour says the same value from step to step: colour: #self.value -> 0..16 -> temperature. A map paints each level flat in its key's colour.value-colour-stylecolormulticolourwidth1.5stylesolid, dashed or dotted. One value for every level.soliddasheddottedsolidopacity1hiddenhidden: true !cue.to{false}(at: 2) is its reveal.falselocklockedfalselayergroupgroup: Early sown, Projected. It is drawn in the colour of the first that has one and the style of the first the graph's key: gives one, unless it writes its own colour: or style, 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.
valuecolour: follows as #self.value: colour: #self.value -> -1..1 -> temperature pins the window the ramp spans, and a map paints each level flat.min{{#id.min}}.max#Allowed in
#Examples


graph{
contour(expression: x^2 - y^2; levels: -4, -1, 0, 1, 4; colour: teal)
}(
x-domain: [-4, 4]
y-domain: [-4, 4]
)

graph{
contour(expression: x^2 + y^2; levels: 1, 2, 4, 8)
}(
x-domain: [-4, 4]
y-domain: [-4, 4]
)

graph{
contour(expression: sin(x) * cos(y); level count: 14; colour: temperature)
}

graph:xyz{
surface(expression: 9 - x^2 - y^2; opacity: 0.25)
contour(expression: 9 - x^2 - y^2; level count: 6)
contour(expression: 9 - x^2 - y^2; level count: 6; on: surface)
}(
x domain: [-3, 3]
y domain: [-3, 3]
z domain: [0, 9]
)