# Reference

- [Shapes](https://learnpython.strivemath.com/p5-python-web/reference/shapes.md): the fundamental feature of p5 is that drawing shapes is easy! 2D and 3D shapes are available
- [2D](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d.md): These pages explain how to use the 2D primitives in the library
- [point()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/point.md): Point - Draws a point with the given inputs
- [line()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/line.md): Line - Draws a line segment with the given inputs
- [rect()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/rect.md): Rectangle - Draws a rectangle with the given inputs
- [square()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/square.md): Square - Draws a square with the given inputs
- [triangle()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/triangle.md): Triangle - Draws a triangle with the given inputs
- [circle()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/circle.md): Circle - Draws a Circle with the given inputs
- [ellipse()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/ellipse.md): Ellipse - Draws an Ellipse with the given inputs
- [arc()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/arc.md): Arc - Draws an Arc with the given inputs
- [quad()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/quad.md): Quadrilateral - Draws a Quadrilateral with the given inputs
- [beginShape()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/2d/beginshape.md): Draws a polygon with any number of given vertices.
- [3D](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d.md): These pages explain how to use the 3D primitives in the library
- [plane()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/plane.md): Plane - Draws a flat 2D bounded surface in 3D
- [box()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/box.md): Box - Draws a cuboid/rectangular prism
- [sphere()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/sphere.md): Sphere - Draws a 2-sphere (sphere in 3D space)
- [cone()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/cone.md): Cone - Draws a cone in 3D space
- [cylinder()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/cylinder.md): Cylinder - draws a cylinder in 3D space
- [ellipsoid()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/ellipsoid.md): Ellipsoid - Draws an ellipsoid/deformed sphere in 3D s\[ace
- [torus()](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/torus.md): Torus - Draws a Torus or Donut-like shape in 3D space
- [Controlling the environment](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment.md): These functions control other aspects of the canvas, or the modes of various drawing functions
- [coordinateMode()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/coordinatemode.md): changes where the coordinates originate from
- [rectMode()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/rectmode.md): changes the way a rectangle is drawn from the inputs
- [ellipseMode()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/ellipsemode.md): changes the way an ellipse is drawn from the inputs
- [frameRate()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/framerate.md): changes the number of frames drawn per second
- [setup()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/setup.md): Initializes the canvas
- [draw()](https://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/draw.md): Renders to the canvas repeatedly, frame by frame
- [Built-in Variables](https://learnpython.strivemath.com/p5-python-web/reference/built-in-variables.md): These variables are automatically available in all p5 sketches
- [Environment](https://learnpython.strivemath.com/p5-python-web/reference/built-in-variables/environment.md): These variables keep track of attributes of the p5 environment
- [Keyboard](https://learnpython.strivemath.com/p5-python-web/reference/built-in-variables/keyboard.md): These built-in variables will give you information about the keyboard.
- [Mouse](https://learnpython.strivemath.com/p5-python-web/reference/built-in-variables/mouse.md)
- [Built-in Functions](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions.md): These functions are automatically available in any p5 sketch
- [keyIsDown()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/keyisdown.md): Checks whether a certain key is down
- [millis()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/millis.md): Gets system's milliseconds
- [second()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/second.md): Gets system's second
- [minute()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/minute.md): Gets system's minute
- [hour()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/hour.md): Get system's hour
- [translate()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/translate.md): Shifts the entire coordinate system by a horizontal and vertical amount
- [rotate()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/rotate.md): Rotates the entire coordinate system around the origin
- [createSlider()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/createslider.md): Creates a HTML Slider element
- [createGraphics()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/creategraphics.md): Creates an additional canvas that can be overlaid on any other existing canvases
- [createVector()](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/createvector.md): Creates a 2D or 3D Geometric vector from coordinates
- [Events](https://learnpython.strivemath.com/p5-python-web/reference/events.md): These functions will automatically trigger upon certain events
- [Keyboard](https://learnpython.strivemath.com/p5-python-web/reference/events/keyboard.md)
- [keyPressed()](https://learnpython.strivemath.com/p5-python-web/reference/events/keyboard/keyboard.md)
- [keyReleased()](https://learnpython.strivemath.com/p5-python-web/reference/events/keyboard/keyboard-1.md)
- [Mouse](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse.md)
- [mouseMoved()](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse/keyboard.md)
- [mouseDragged()](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse/keyboard-1.md)
- [mousePressed()](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse/keyboard-2.md)
- [doubleClicked()](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse/keyboard-3.md)
- [mouseWheel()](https://learnpython.strivemath.com/p5-python-web/reference/events/mouse/keyboard-4.md)
- [Text](https://learnpython.strivemath.com/p5-python-web/reference/text.md): These functions control the appearance of text on the canvas
- [text()](https://learnpython.strivemath.com/p5-python-web/reference/text/text.md): Displays text on canvas
- [textSize()](https://learnpython.strivemath.com/p5-python-web/reference/text/textsize.md): Set size of text
- [textAlign()](https://learnpython.strivemath.com/p5-python-web/reference/text/textalign.md): Set how text is aligned
- [Math](https://learnpython.strivemath.com/p5-python-web/reference/math.md): These functions give access to commonly used mathematical functions
- [drawTickAxes()](https://learnpython.strivemath.com/p5-python-web/reference/math/drawtickaxes.md): Draws a grid of numbered horizontal and vertical lines showing the X and Y axes of the Cartesian plane
- [random()](https://learnpython.strivemath.com/p5-python-web/reference/math/random.md): Generate a random number between two values based on a uniform probability distribution
- [randomGaussian()](https://learnpython.strivemath.com/p5-python-web/reference/math/randomgaussian.md): Generate a random number based on a Gaussian probablity distribution
- [dist()](https://learnpython.strivemath.com/p5-python-web/reference/math/dist.md): Calculate the distance between 2 points
- [linmap()](https://learnpython.strivemath.com/p5-python-web/reference/math/linmap.md): Re-maps a number from one range to another.
- [bounce()](https://learnpython.strivemath.com/p5-python-web/reference/math/linmap-1.md): Returns a value that varies back and forth between 2 given limits with time. The movement is linear.
- [wave()](https://learnpython.strivemath.com/p5-python-web/reference/math/linmap-2.md): Returns a value that varies back and forth between 2 given limits with time. The motion is wave-like, NOT linear.
- [Colour and Outline](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline.md): These functions control colors and outlines of shapes
- [colorMode()](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/colormode.md): Changes how colors are specified - using (Red, Green, Blue) or (Hue, Saturation, Brightness)
- [fill()](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/fill.md): Changes color of shape interiors
- [stroke()](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/stroke.md): Changes color of lines or shape borders
- [strokeWeight()](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/strokeweight.md): Changes thickness of lines
- [background()](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/background.md): Sets the background color of the canvas
- [Images & Audio](https://learnpython.strivemath.com/p5-python-web/reference/images-and-audio.md): These functions allow external images or audio to be used in p5 sketches
- [loadImage() and image()](https://learnpython.strivemath.com/p5-python-web/reference/images-and-audio/loadimage-and-image.md): Loads an image into the code's assets
- [loadSound()](https://learnpython.strivemath.com/p5-python-web/reference/images-and-audio/loadsound.md): Loads a sound into the code's assets
- [3D Controls](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls.md): These controls allow for moving or navigating a 3D canvas (WEBGL enabled)
- [orbitControl()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/orbitcontrol.md): Allows the mouse to control the 3D camera
- [translate()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/translate.md): Translates the 3D coordinate system
- [rotateZ()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/rotatez.md): Rotates in 3D around the z-axis
- [rotateX()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/rotatex.md): Rotates in 3D around the x-axis
- [rotateY()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/rotatey.md): Rotates in 3D around the y-axis
- [scale()](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/scale.md): Scales Object in 3D from the Origin


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learnpython.strivemath.com/p5-python-web/reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
