Overview
Introduction
A sine wave is one of the most recognizable curves in math, and rendering one directly as plain text is a satisfying, dependency-free way to get eye-catching ASCII art.
This tool plots a sine wave across a grid you size and tune yourself, one character wide per column, with the frequency controlling how many cycles fit across the width.
What Is ASCII Wave Drawer?
A generator that computes `sin()` at evenly spaced points across the chosen width and plots the resulting y-position on a blank-space grid using a single chosen character.
Width, height, frequency, and the plotting character are all independently configurable, letting you tune the wave's shape and appearance.
How ASCII Wave Drawer Works
For each column x from 0 to width-1, the tool computes an angle proportional to x, the frequency, and a full 2π cycle, then evaluates the sine of that angle.
The sine result (which ranges from -1 to 1) is mapped onto the grid's row range (0 to height-1), and the chosen character is placed at that single row/column position; every other grid cell stays a blank space.
When To Use ASCII Wave Drawer
Use it to generate decorative ASCII wave art for a terminal banner, README, or chat message.
It's also a simple, visual way to demonstrate how a sine function's frequency and amplitude relate to a plotted curve's shape.
Often used alongside ASCII Spiral Generator, ASCII Art Generator and ASCII Art Smiley Generator.
Features
Advantages
- Fully deterministic and configurable, the same width/height/frequency/character combination always produces the same wave.
- No external dependencies, the entire curve is computed with plain trigonometry.
- Works with any single ASCII character, letting you match the wave's look to your context (e.g. ~ for water, * for stars).
Limitations
- Only plots a single point per column (one row per x-position), it doesn't draw a filled or thickened wave band.
- Width and height are capped (10-200 and 3-60 respectively) to keep the output readable and reasonably sized.
Examples
Best Practices & Notes
Best Practices
- Use a taller grid (more rows) for a smoother-looking curve; very short heights round multiple x-positions to the same row, flattening the visual wave.
- Keep frequency proportional to width, a very high frequency on a narrow grid can alias into a pattern that no longer looks like a smooth wave.
Developer Notes
The angle per column is computed as `(x / width) * frequency * 2π`, its sine mapped from the [-1, 1] range to a grid row via `Math.round(((height - 1) / 2) * (1 - sin(angle)))` (inverted so positive sine values plot toward the top row, matching typical up-is-positive wave conventions), and every other grid cell defaults to a space character.
ASCII Wave Drawer Use Cases
- Generating decorative wave-shaped ASCII art for a terminal splash screen or README banner
- Demonstrating visually how sine wave frequency affects the number of cycles across a fixed width
- Producing a quick, dependency-free plain-text wave pattern for a chat message or forum post
Common Mistakes
- Setting the height too small and expecting a smooth-looking curve; very short grids round several columns' values to the same row.
- Entering more than one character (or a non-ASCII character) for the plot character, only a single strict-ASCII character is accepted.
Tips
- Try a few different frequency values at the same width and height to see how the wave compresses or stretches.
- Pair with the ASCII Spiral Generator if you want a curved pattern that grows outward instead of oscillating left to right.