grid

A coordinate grid system with customizable bounds and background

Foundation Object

✨ Examples

Basic Grid
grid G: (-5, 5, -5, 5) (color: gray, strokeWidth: 1)
Creates a standard coordinate grid from -5 to 5 on both axes
Custom Background
grid coords: (-10, 10, -10, 10) (step: 2, backgroundColor: lightblue)
Grid with custom step size and light blue background
Clean Professional
grid clean: (-3, 3, -3, 3) (backgroundColor: white, color: #ddd)
Minimal grid perfect for presentations and publications
Dark Theme
grid dark: (-5, 5, -5, 5) (backgroundColor: #2d3436, color: #636e72, axisColor: white)
Modern dark theme with custom axis highlighting

🔧 Properties & Styles

🎯 Properties

  • xmin
    Minimum X coordinate
    number
  • xmax
    Maximum X coordinate
    number
  • ymin
    Minimum Y coordinate
    number
  • ymax
    Maximum Y coordinate
    number
  • step
    Grid line spacing (default: 1)
    number

🎨 Styles

  • backgroundColor
    Background color (default: white)
    color
  • color
    Grid line color (default: lightgray)
    color
  • strokeWidth
    Line thickness (default: 1)
    number
  • axisColor
    Main axis color (default: auto)
    color
  • showAxes
    Show main axes (default: true)
    boolean

point

A 2D point that can use mathematical expressions and reference other objects

Mathematical Expression Support

✨ Examples

Simple Point
point A: (3, 4)
Basic point at coordinates (3, 4)
Reference Other Points
point B: (A.x + 1, A.y * 2)
Point that uses coordinates from point A
Mathematical Expressions
point C: (sin(pi/4), cos(pi/4))
Point using trigonometric functions
Styled Point
point center: (0, 0) (fill: red, size: 5, label: "Origin")
Large red point with a label at the origin

🔧 Properties & Styles

🎯 Properties

  • x
    X coordinate (can be expression)
    number
  • y
    Y coordinate (can be expression)
    number

🎨 Styles

  • fill
    Point color (default: #000000)
    color
  • size
    Point radius (default: 3)
    number
  • label
    Text label for the point
    string
  • opacity
    Transparency (default: 1)
    number
ƒ

function

Plot mathematical functions using Math.js or fallback evaluator

Advanced Mathematical Plotting

✨ Examples

Parabola
function parabola: (x^2, -3, 3)
Simple quadratic function
Trigonometric
function wave: (sin(x) + cos(2*x), -pi, pi) (stroke: purple)
Combined sine and cosine waves
Exponential
function exp: (e^x, -2, 2, 200) (stroke: green, strokeWidth: 2)
Exponential function with high sampling
Rational Function
function rational: ((x^2-1)/(x^2+1), -5, 5) (stroke: red)
Complex rational function

🔧 Properties & Styles

🎯 Properties

  • fn
    Mathematical expression
    string
  • xmin
    Domain start
    number
  • xmax
    Domain end
    number
  • samples
    Plot resolution (default: 100)
    number

🎨 Styles

  • stroke
    Line color (default: #000000)
    color
  • strokeWidth
    Line thickness (default: 1)
    number
  • fill
    Fill area under curve
    color
  • label
    Function label
    string

vector

A vector (arrow) with position and direction, supports vector math and angle-based construction

Vector Mathematics Support

✨ Examples

Basic Vector
vector force: (0, 0, 2, 1) (stroke: red)
Vector from origin with displacement (2,1)
Point-to-Point
vector velocity: (A, B) (headSize: 0.3)
Vector between two named points
Vector Addition
vector sum: (V1+V2)
Resultant of vector addition
Angle-Based
vector rotated: (V1, 90, 2) (stroke: blue)
Vector 90° from V1 with length 2
T

text

A text label at a given position with optional styling or LaTeX rendering

LaTeX Support Available

✨ Examples

Simple Text
text label1: ("Hello", 2, 3)
Basic text at coordinates (2,3)
LaTeX Equation
text eqn: ("$x^2 + y^2 = r^2$", P) (latex: true, fontSize: 20)
Mathematical equation with LaTeX rendering
Styled Text
text note: (label: "Note here", x: 1, y: -1) (size: 16, color: "red")
Colored text with custom positioning

circle

A circle defined by (x,y,r), (label,r), or (x:, y:, r:)

Multiple Definition Formats

✨ Examples

Basic Circle
circle C: (1, 2, 3)
Circle at (1,2) with radius 3
Named Point Center
circle unit: (origin, r: 1)
Unit circle centered at named point
Explicit Properties
circle originCircle: (x: 0, y: 0, r: 2)
Circle using explicit property syntax

line

A straight line defined by two points (named or explicit)

Point Reference Support

✨ Examples

Named Points
line L: (A, B) (stroke: blue)
Line between two named points
Explicit Coordinates
line segment1: (0, 0, 3, 4) (strokeWidth: 2)
Line from (0,0) to (3,4) with thick stroke

poly

A polygon defined by multiple points with optional labeling

Flexible Point Definition

✨ Examples

Named Points
poly triangle: (A, B, C)
Triangle using three named points
Coordinate List
poly square: (0, 0, 1, 0, 1, 1, 0, 1) (fill: blue, label: "Square")
Square with fill color and label

rect

A rectangle defined by position and dimensions

Position & Size Based

✨ Examples

Basic Rectangle
rect box: (0, 0, 2, 1) (fill: blue)
Rectangle at origin with width 2, height 1
Explicit Properties
rect detailed: (x: 0, y: 0, width: 3, height: 2) (label: "Box")
Rectangle with explicit property syntax and label

oval

An oval (ellipse) defined by center position and radii

Ellipse Support

✨ Examples

Basic Ellipse
oval shape: (0, 0, 2, 1) (fill: blue)
Ellipse centered at origin with radii 2 and 1
Explicit Properties
oval detailed: (cx: 0, cy: 0, rx: 2, ry: 1) (label: "Ellipse")
Ellipse with explicit center and radii properties