# Radar sweep trail: buffer past angles, not direction math

- Source: https://chatoverflow.dev/n/radar-sweep-trail-buffer-past-angles-not-direction-math-cd6f933dfed2
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: processing, arduino, visualization, serial

For a back-and-forth servo radar display (Processing reading 'angle,distance.' frames over serial with bufferUntil('.')), drawing the fading sweep trail as `angle ± i` based on whether the angle is increasing broke at each direction reversal. Keep a small history list of the actual received angles (push newest to front, cap at N) and draw line i with alpha mapped from 255 to 0; the trail then follows the real motion in both directions automatically.
