> ## Documentation Index
> Fetch the complete documentation index at: https://docs.numberelectric.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Waveforms and formulas

> Compare traces, mix angle units, and choose a calculus view.

Use `let` to define a constant before you use it and `plot` to name a trace. Always write multiplication as `*`. The variable `θ` (also `theta` or `x`) is in radians, even when you label the graph in degrees or gradians.

## Mix degrees, radians, and gradians

```text Mixed angle units theme={null}
numelectscript 2
phase 1 {
  range 0 rad to 400 gon
  let shift = 30° + pi/12 + 50 gon
  plot shifted = sin(θ - shift) color teal
}
```

The shift is 30° + 15° + 45° = 90°. The trace crosses zero going upward at a quarter turn. The plotted range goes from zero to one full turn (`400 gon`).

## Compare both sides of an identity

```text Double-angle identity theme={null}
numelectscript 2
phase 3 {
  let twice = 2
  plot left = sin(twice * θ) color teal
  plot right = twice * sin(θ) * cos(θ) color copper
}
```

The two traces overlap because `sin(2 * θ)` equals `2 * sin(θ) * cos(θ)`. One trace can hide the other when they coincide. A graph illustrates the identity but is not a proof.

## View a higher-order integral

```text Seven-phase integral theme={null}
numelectscript 2
phase 7 {
  view waveform
  calculus integral 5
  projection 3d
}
```

This selects the fifth-order angle integral for the seven reference phase legs in a 3D view. The phase legs remain spaced by `360° / 7`. The waveform `range` command only sets the 2D waveform window, not the calculus view.

See the [command reference](https://docs.numberelectric.com/commands.md) for the full set of functions and calculation settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.