Radar Display
What is a radar display?
A radar display (also called a radar screen, or a PPI scope from plan position indicator) is a map-like picture of what a radar has detected around it. The radar sits at the centre, the angle around the circle shows bearing, the distance from the centre shows range, and a rotating sweep line repaints each direction as the antenna turns.

A simulated surveillance radar display: a 60 NM north-up PPI with a coastline map, tracks, trails and data blocks. Try the interactive version.
- The centre is the radar, the angle is bearing (000° is north) and the distance from the centre is range, read against the range rings.
- A blip is one raw echo; a track is the radar computer's estimate of one object's position, course and speed, built from echoes over several sweeps.
- Primary radar sees anything that reflects; secondary radar adds the transponder code and altitude that aircraft send back, which become the labels next to each track.
- Clutter from waves, rain and the ground can hide real targets. Gain, sea and rain controls and Doppler filters remove it, and can remove weak targets with it.
- Air traffic control, ships and air defence all use the same picture, with different symbols, labels and ranges.
How a radar measures range and bearing
A pulse radar sends out a short burst of radio energy and listens for echoes. Two measurements place every echo on the screen.
- Range comes from the time the echo takes to come back. The pulse travels out and back at the speed of light, so the range is the speed of light times the delay, divided by two: R = c·t/2. An echo that returns 247 microseconds after the pulse is 37.0 km away, which is 20.0 nautical miles (NM).
- Bearing comes from where the antenna is pointing when the echo arrives. A surveillance antenna has a narrow beam in the horizontal plane, typically a degree or two wide, and turns steadily, so the radar knows the direction of each echo from the antenna's angle at that moment.
Radar people sometimes quote the radar mile: about 12.36 microseconds, the round-trip time to a target 1 NM away. Because the beam has a width, a point target shows as a short arc rather than a dot. A 1.4° beam at 40 NM is about 1 NM wide, so two aircraft side by side at that range can merge into one blip, while two at the same bearing but different ranges stay separate.
How often the radar sends pulses (its pulse repetition interval, PRI) sets the longest range it can measure without ambiguity; a passive receiver measures the same PRI to identify a radar, as described in ELINT: radar pulse analysis.
How to read a radar screen
Read a radar screen from the centre outwards, in this order:
- Own position. The radar, or your own ship or aircraft, is at the centre. Everything else is placed relative to it.
- Range. Count the range rings out to the echo. On a 40 NM display with rings every 10 NM, an echo just past the third ring is a little over 30 NM away. Marine radars add a variable range marker, an adjustable ring for an exact reading.
- Bearing. Read the angle on the scale round the edge: 000° is north, 090° east, 180° south and 270° west. A bearing is always from the radar to the target. Marine radars add an electronic bearing line, a movable spoke for exact readings.
- The sweep. The bright spoke is where the antenna is pointing now. Each echo is refreshed only when the sweep passes it, so everything you see is between zero and one rotation old. An airport approach radar turns about once every 4.8 seconds; a long-range en route radar about once every 12 seconds.
- Afterglow. Old radar tubes used a long-persistence phosphor (such as P7), so echoes kept glowing and faded as the sweep moved on. Digital displays copy this in software: the brightest echoes are the newest.
- Blips. A blip is a raw echo. Its brightness depends on how much energy came back, not on how big or dangerous the object is.
- Tracks. A symbol marks each tracked object. Dots behind it show where it was on earlier sweeps (its trail), and a line ahead of it shows where it will be in a set time if it keeps its course and speed.
- Labels. On air traffic control and military displays, a data block next to each track gives its identity, altitude and speed.
North-up, head-up and course-up
The display can be turned three ways. Ship radars must offer north-up and course-up, and many also offer head-up; surveillance radars on land use north-up.
| Mode | Top of the screen | Good for | Watch out for |
|---|---|---|---|
| North-up | True north | Comparing with a chart; the picture stays still when you turn | Your heading is shown by a line, not by "up" |
| Head-up | Your own ship's or aircraft's heading | Matching the view out of the window: left on screen is to port | The whole picture rotates every time you turn, and trails smear |
| Course-up | The course you set | A steady picture that still roughly matches the view ahead | Must be reset after a big change of course |
Marine radars also show motion in two ways: relative motion, where your own ship stays at the centre and other targets move relative to you, and true motion, where your own ship moves across a fixed picture. In relative motion, a target whose bearing stays the same while its range closes is on a collision course.
Blips, plots and tracks
On a modern radar, a computer also turns the echoes into tracks, in three steps.
- Detection. For every cell of range and bearing, the processor decides whether an echo stands out from the noise around it. Many radars use a threshold that rises and falls with the local noise and clutter, called constant false alarm rate (CFAR) detection, so a patch of rain doesn't fill the screen with false detections.
- Plot extraction. The detections from one object on one sweep, which span a few beam positions and range cells, are merged into a single plot with one range, one bearing and a time.
- Tracking. Each new plot is matched to an existing track, and a filter (often an alpha-beta or Kalman filter) smooths the positions and estimates course and speed. A new track starts tentative and is confirmed only after it has been seen on several sweeps.
A track behaves differently from a blip in three ways.
- Tracks lag. The course and speed are estimated from past plots, so after a sharp turn the velocity line points the old way for a few sweeps.
- Tracks coast. If one sweep gets no echo, the tracker carries the track forward on its last course and speed.
- Trails show history. The trail is the record of past plots, so its spacing shows speed (wide gaps are fast) and its shape shows turns. A slow ship's trail is a short line of dots close together; an airliner's is long.
Primary and secondary radar
Air traffic control uses two radars together, and they show different things.
| Primary surveillance radar (PSR) | Secondary surveillance radar (SSR) | |
|---|---|---|
| How it works | Detects echoes of its own pulses reflected by any object | Sends an interrogation; the aircraft's transponder transmits a coded reply |
| What it sees | Aircraft, ships, birds, weather, terrain: anything that reflects | Only aircraft with a working transponder |
| What it measures | Range and bearing | Range and bearing, plus the reply's identity code and pressure altitude |
| On the screen | A blip or a primary-only track symbol | A track with a data block |
SSR interrogates on 1030 MHz and aircraft reply on 1090 MHz. The main reply modes are:
- Mode A: a four-digit identity code, the squawk, set by the pilot as the controller instructs. Each digit is 0 to 7, giving 4,096 codes. Three are reserved for emergencies: 7500 for unlawful interference (hijacking), 7600 for radio failure and 7700 for a general emergency.
- Mode C: the aircraft's pressure altitude, in 100 ft steps. It's displayed as a flight level: FL350 is 35,000 ft on the standard pressure setting.
- Mode S: selective interrogation of each aircraft by its unique 24-bit address, with room for more data such as the callsign.
The controller's data block shows the callsign or squawk and the flight level, and often the ground speed. Many control centres now also receive ADS-B, in which aircraft broadcast their own satellite navigation (GNSS) position, and merge it with the radar tracks into one track per aircraft.
A track with no transponder reply is primary-only. To a controller, that can be a light aircraft without a transponder, a flock of birds or a weather echo. To an air defence operator, it is an object whose identity is still to be established.
Radar clutter and how to reduce it
Clutter is any unwanted echo. It can hide a real target that is on the screen.
| Clutter | What it looks like | Where | How operators reduce it |
|---|---|---|---|
| Sea clutter | A bright, speckled area round the centre that changes every sweep | Close to the radar, out to a few miles, stronger upwind and in rough seas | Sensitivity time control (STC, the "sea" control), which lowers the gain at short range |
| Rain clutter | A broad, grainy patch with soft edges, moving with the wind | Wherever there is rain, snow or hail | Fast time constant (FTC, the "rain" control), which keeps the edges of echoes and suppresses broad ones; circular polarisation; a lower frequency (S-band) radar |
| Ground clutter | Fixed, strong echoes from hills, buildings and coastlines | Over land, strongest close in | Moving target indication (MTI) and Doppler filters, which remove echoes that don't move; clutter maps |
Too much sea control removes a small boat inside the clutter along with the waves. Too much rain control can thin a real target to its edges. Moving target filters see only motion towards or away from the radar, so an aircraft flying at right angles to the beam can fade along with the ground clutter; this is called tangential fade. Modern radars reduce it by keeping a separate zero-velocity channel with a clutter map, so a strong crossing target can still be seen.
Weather radar is the opposite case: there the rain is the signal. For what the colours on a weather radar mean, see how to read weather radar.
Radar displays in air traffic control, at sea and in air defence
The PPI is the same idea everywhere, but each field adds its own layers.
| Setting | Typical range | What's added to the picture | Main question for the operator |
|---|---|---|---|
| Air traffic control | About 60 NM for an approach radar, 200 to 250 NM for a long-range en route radar | Video maps of airways, airports and boundaries; SSR data blocks; ADS-B tracks; conflict alerts | Are aircraft keeping the required separation? |
| Marine navigation | Chosen by the navigator: under a mile in harbour, tens of miles at sea | Range markers and bearing lines; target tracking with closest point of approach (CPA) and time to it (TCPA); AIS targets; charts | Will any vessel pass too close? |
| Air defence surveillance | Out to the radar horizon, often combining several radars | Identity symbols and colours; tracks from other sensors | What is each contact, and is any of them a threat? |
Identity symbols and colours
Military displays show each track's identity with a frame shape and colour. The public symbol standards used by NATO forces (APP-6) and the US (MIL-STD-2525) define four basic identities. The colours are pale tints, and air tracks use the top half of each frame, open at the bottom:
| Identity | Colour | Frame on land | Frame for air tracks |
|---|---|---|---|
| Friend | Light blue | Rectangle | Dome |
| Neutral | Light green | Square | Top half of a square |
| Unknown | Light yellow | Quatrefoil (four-leaf clover) | Top half of a quatrefoil |
| Hostile | Light red | Diamond | Pointed top half of a diamond |
Identity is assigned by people and rules, not by the radar. An echo that hasn't been identified starts as unknown; the operator or the system changes it as information comes in.
Common mistakes reading a radar display
- Reading blip size as target size. A blip's size comes from the beamwidth and the pulse length, and its brightness from how well the object reflects. A small boat with a metal mast can outshine a larger wooden one.
- Forgetting the radar horizon. The radar beam travels in a nearly straight line, so the curve of the Earth hides low targets. A radar 30 m above the sea and an aircraft 150 m above it can see each other only out to about 73 km (39 NM). No echo doesn't mean nothing is there.
- Confusing bearing with heading. Bearing is the direction from the radar to the target. Heading is where the target is pointing, shown by the velocity line or the trail, not by its position on the screen.
- Trusting a track after a turn. The velocity line is an estimate from past plots and lags a manoeuvre by a few sweeps.
- Reading a head-up display as north-up. On a head-up screen, 000° on the bezel is your bow, not north. Check the mode before reporting a bearing.
- Turning the clutter controls up to clear the screen. A clean picture can mean that weak targets have been removed with the clutter.
- Assuming a missing label means a hostile. A primary-only track can be a light aircraft without a transponder, birds or weather.
How to build a radar display in JavaScript, React or Angular
Radar software has to redraw thousands of range and bearing cells and dozens of tracks every time the sweep moves, many times a second. The demo below is a simulated coastal surveillance radar: a 60 NM north-up PPI where the antenna turns once every 4 seconds and each turn stands for 12 seconds of real time. SciChart.js draws the radar video as a polar heatmap that fades like phosphor, with the sweep, coastline, trails and velocity lines as polar line and scatter series, and the data blocks as a polar text series. All the contacts, clutter and noise are synthetic and generic. The light aircraft is a weak echo that the radar sometimes misses, so its track coasts. The fast contact with no transponder reply starts as unknown and is declared hostile after eight sweeps, so you can see its symbol change. The symbols are simplified closed shapes in brighter colours than the standards use, so they read well on a dark screen.
Hover over a track to read its range, bearing, speed, heading and transponder reply, or anywhere else for the cursor's range and bearing. Untick Trails or Labels to declutter, tick Clutter (filters off) to see sea, rain and ground clutter, scroll to change the range scale and double-click to reset it.
Here is the code for this chart. The scenario, the clutter and the simple tracker are plain JavaScript. SciChart.js draws the radar picture.
- JavaScript
- React
- Angular
// A simulated surveillance radar PPI scope on a polar chart: a rotating sweep with fading afterglow, range rings,
// a bearing scale, and tracks with trails, labels and identity symbols, charted with SciChart.js
const {
SciChartPolarSurface,
PolarNumericAxis,
EPolarAxisMode,
EPolarLabelMode,
EPolarGridlineMode,
NumberRange,
EAutoRange,
UniformHeatmapDataSeries,
PolarUniformHeatmapRenderableSeries,
HeatmapColorMap,
PolarLineRenderableSeries,
PolarColumnRenderableSeries,
XyxDataSeries,
EColumnMode,
GradientParams,
Point,
PolarXyScatterRenderableSeries,
PolarTextRenderableSeries,
XyDataSeries,
XyTextDataSeries,
EllipsePointMarker,
CrossPointMarker,
SpritePointMarker,
createImageAsync,
EHorizontalTextPosition,
EVerticalTextPosition,
CustomChartModifier2D,
EModifierType,
translateFromCanvasToSeriesViewRect,
SciChartJsNavyTheme,
PolarMouseWheelZoomModifier,
PolarZoomExtentsModifier
} = SciChart;
// or, for npm, import { SciChartPolarSurface, ... } from "scichart"
const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(ui.chartDiv, {
theme: new SciChartJsNavyTheme()
});
sciChartSurface.background = "#0B1A2E";
// Bearing: 0° (north) at the top, increasing clockwise like a compass. North-up, as on most surveillance displays
const bearingAxis = new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
visibleRange: new NumberRange(0, 360),
autoRange: EAutoRange.Never,
startAngle: Math.PI / 2,
flippedCoordinates: true,
autoTicks: false,
majorDelta: 30,
labelPrecision: 0,
labelPostfix: "°",
polarLabelMode: EPolarLabelMode.Horizontal,
drawMinorGridLines: false,
drawMajorBands: false,
majorGridLineStyle: { strokeThickness: 1, color: "#7CFFB222" }
});
// Range: distance from the radar. The circular gridlines are the range rings, every 10 NM
const rangeAxis = new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Radial,
visibleRange: new NumberRange(0, MAX_RANGE_NM),
autoRange: EAutoRange.Never,
autoTicks: false,
majorDelta: 10,
labelPrecision: 0,
labelPostfix: " NM",
startAngle: Math.PI / 2,
gridlineMode: EPolarGridlineMode.Circles,
drawMinorGridLines: false,
drawMajorBands: false,
majorGridLineStyle: { strokeThickness: 1, color: "#7CFFB244" },
labelStyle: { color: "#9FE8BD" }
});
// Bearings are written with three digits on radar displays: 000°, 030°, 090°
bearingAxis.labelProvider.formatLabel = (value) => `${pad3(value)}°`;
sciChartSurface.xAxes.add(bearingAxis);
sciChartSurface.yAxes.add(rangeAxis);
// The radar video: one cell per degree and half mile, holding how brightly it glows (0 to 1). Each turn of the
// sweep writes fresh echoes into the cells it passes; between turns every cell fades, like long-persistence phosphor
const video = Array.from({ length: GATES }, () => new Float64Array(AZIMUTHS).fill(NaN)); // Float64Array rows copy into the chart faster
const videoData = new UniformHeatmapDataSeries(wasmContext, { xStart: 0, xStep: 360 / AZIMUTHS, yStart: 0, yStep: GATE_NM, zValues: video });
videoData.hasNaNs = true;
const phosphor = new HeatmapColorMap({
minimum: 0,
maximum: 1,
gradientStops: [
{ offset: 0, color: "#0B1A2E00" },
{ offset: 0.08, color: "#0F5A3555" },
{ offset: 0.35, color: "#22A75CAA" },
{ offset: 0.7, color: "#7CFFB2EE" },
{ offset: 1, color: "#E8FFF2FF" }
]
});
const videoSeries = new PolarUniformHeatmapRenderableSeries(wasmContext, { dataSeries: videoData, colorMap: phosphor, fillValuesOutOfRange: true });
// The coastline, drawn as a map overlay (a "video map") so the operator can relate echoes to the ground
const coastY = Array.from({ length: 241 }, (_, i) => -60 + i * 0.5);
const coastPoints = coastY.map((y) => ({ x: coastX(y), y })).filter((p) => toRange(p.x, p.y) < MAX_RANGE_NM);
const coastline = new PolarLineRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, {
xValues: coastPoints.map((p) => toBearing(p.x, p.y)),
yValues: coastPoints.map((p) => toRange(p.x, p.y))
}),
stroke: "#C9A96E88",
strokeThickness: 1.5
});
// The sweep line: the antenna's current bearing, from the radar to the edge of the display
const sweepData = new XyDataSeries(wasmContext, { xValues: [0, 0], yValues: [0, MAX_RANGE_NM] });
const sweepGlow = new PolarLineRenderableSeries(wasmContext, { dataSeries: sweepData, stroke: "#7CFFB2", strokeThickness: 8, opacity: 0.25 });
const sweepLine = new PolarLineRenderableSeries(wasmContext, { dataSeries: sweepData, stroke: "#D8FFE8", strokeThickness: 2 });
// The glow behind the sweep: one polar column, a wedge from SWEEP_GLOW_DEG behind the line up to the line,
// filled with a gradient from soft green at the line to clear, so the echoes still show through.
// Two copies, one turn apart: the chart only draws 0° to 360°, so when the wedge crosses north
// the first copy draws the part after 0° and the second the part before 360°.
const glowData = new XyxDataSeries(wasmContext, {
xValues: [-SWEEP_GLOW_DEG, 360 - SWEEP_GLOW_DEG],
x1Values: [0, 360],
yValues: [MAX_RANGE_NM, MAX_RANGE_NM]
});
const sweepWedge = new PolarColumnRenderableSeries(wasmContext, {
dataSeries: glowData,
columnXMode: EColumnMode.StartEnd, // x is where the wedge starts, x1 where it ends
strokeThickness: 0,
// The gradient runs around the circle across the column. The bearing axis is flipped (clockwise, like a compass),
// so offset 0 is the sweep line's end
fillLinearGradient: new GradientParams(new Point(0, 0), new Point(1, 0), [
{ offset: 0, color: "#7CFFB270" },
{ offset: 0.5, color: "#7CFFB21C" },
{ offset: 1, color: "#7CFFB200" }
])
});
function moveSweepWedge(angle) {
glowData.updateXyz(0, angle - SWEEP_GLOW_DEG, MAX_RANGE_NM, angle);
glowData.updateXyz(1, angle - SWEEP_GLOW_DEG + 360, MAX_RANGE_NM, angle + 360);
}
// Own position at the centre
const ownPosition = new PolarXyScatterRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, { xValues: [0], yValues: [0] }),
pointMarker: new CrossPointMarker(wasmContext, { width: 14, height: 14, stroke: "#FFFFFF", strokeThickness: 2 })
});
// For each identity: track symbols, trails of past plots, and velocity leaders (where the track will be in one minute)
const layers = {};
for (const identity of Object.keys(IDENTITIES)) {
const color = IDENTITIES[identity].color;
const image = await createImageAsync(drawSymbol(identity, 18));
layers[identity] = {
symbols: new PolarXyScatterRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext),
pointMarker: new SpritePointMarker(wasmContext, { image })
}),
trails: new PolarXyScatterRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext),
pointMarker: new EllipsePointMarker(wasmContext, { width: 4, height: 4, fill: color + "99", stroke: color + "99", strokeThickness: 0 })
}),
leaders: new PolarLineRenderableSeries(wasmContext, { dataSeries: new XyDataSeries(wasmContext), stroke: color, strokeThickness: 1.5 })
};
}
// Data blocks: the transponder code, flight level and ground speed next to each track
const labelData = new XyTextDataSeries(wasmContext);
const labels = new PolarTextRenderableSeries(wasmContext, {
dataSeries: labelData,
dataLabels: {
style: { fontSize: 12, fontFamily: "Arial" },
color: "#E6F0FF",
horizontalTextPosition: EHorizontalTextPosition.Right,
verticalTextPosition: EVerticalTextPosition.Above
}
});
sciChartSurface.renderableSeries.add(videoSeries, coastline, sweepWedge, sweepGlow, sweepLine, ownPosition);
const allLayers = Object.keys(layers).map((identity) => layers[identity]);
for (const layer of allLayers) sciChartSurface.renderableSeries.add(layer.trails, layer.leaders);
for (const layer of allLayers) sciChartSurface.renderableSeries.add(layer.symbols);
sciChartSurface.renderableSeries.add(labels);
sciChartSurface.chartModifiers.add(new PolarMouseWheelZoomModifier(), new PolarZoomExtentsModifier());
// --- What the radar receives on one beam: noise, clutter and target echoes ---
let rng = makeRandom(20261126);
// Rain: a band of showers to the south-east, drifting slowly north-east
const rainAt = (x, y, scan) => {
const rx = x - 24 - scan * 0.04;
const ry = y + 22 - scan * 0.03;
return Math.exp(-((rx * 0.9 + ry * 0.5) ** 2) / 40 - ((ry * 0.9 - rx * 0.5) ** 2) / 12);
};
function receive(col, row, scan, showClutter) {
const rangeNm = (row + 0.5) * GATE_NM;
const bearing = ((col + 0.5) * Math.PI) / 180;
const x = rangeNm * Math.sin(bearing);
const y = rangeNm * Math.cos(bearing);
// Receiver noise: faint speckle everywhere, different on every turn, which leaves the glowing wedge behind the sweep
let v = rng() < 0.25 ? 0.1 + 0.2 * rng() : 0.07;
if (!showClutter) return v;
const overLand = x < coastX(y);
// Ground clutter: strong, fixed echoes from hills and buildings on land, strongest close in
if (overLand && hash01(col, row, 3) < 0.55 * Math.exp(-rangeNm / 14)) v = Math.max(v, 0.45 + 0.5 * hash01(col, row, 4));
// Sea clutter: echoes from waves, strongest near the radar and gone by about 8 NM, changing every turn
if (!overLand && rng() < Math.exp(-rangeNm / 2.5)) v = Math.max(v, 0.3 + 0.6 * rng() * Math.exp(-rangeNm / 6));
// Rain clutter: a broad, grainy area that hides anything inside it
const rain = rainAt(x, y, scan);
if (rain > 0.15 && rng() < rain) v = Math.max(v, 0.3 + 0.5 * rain * rng());
return v;
}
// --- Tracks: a plot is made when the sweep passes a contact, and the track keeps its last few plots as a trail ---
const tracks = CONTACTS.map((contact) => ({ contact, plots: [], lastPlotScan: -1, identity: contact.identity, state: null }));
function plotContact(track, scan) {
const { contact } = track;
const p = positionAt(contact, scan);
const range = toRange(p.x, p.y);
if (range > MAX_RANGE_NM - 1) return; // off the display
track.identity = contact.hostileFromScan !== undefined && scan >= contact.hostileFromScan ? "hostile" : contact.identity;
const fl = contact.flightLevel === null ? null : Math.round(contact.flightLevel - (contact.descentPerScan || 0) * scan);
track.state = { x: p.x, y: p.y, heading: p.heading, speed: contact.speed, flightLevel: fl, coasting: false };
if (rng() > (contact.detectProbability || 0.97)) {
track.state.coasting = true; // no echo this turn: the tracker carries the track on its last course and speed
return;
}
// The plot: the measured position, with a little range and bearing error
const bearing = toBearing(p.x, p.y) + (rng() - 0.5) * 0.6;
const measuredRange = range + (rng() - 0.5) * 0.15;
track.plots.push({ bearing, range: measuredRange });
if (track.plots.length > TRAIL_LENGTH + 1) track.plots.shift();
track.lastPlotScan = scan;
// Paint the echo into the video: about one beamwidth wide and one range cell deep
const row = Math.floor(measuredRange / GATE_NM);
const strength = contact.kind === "surface" ? 1 : contact.speed < 150 ? 0.7 : 0.9;
for (let d = -BEAMWIDTH_DEG; d <= BEAMWIDTH_DEG; d += 0.5) {
const col = ((Math.round(bearing + d) % AZIMUTHS) + AZIMUTHS) % AZIMUTHS;
const fall = 1 - Math.abs(d) / (BEAMWIDTH_DEG * 1.4);
for (const r of [row, row + 1]) if (r >= 0 && r < GATES) video[r][col] = Math.max(video[r][col] || 0, strength * fall);
}
}
function redrawTracks() {
for (const identity of Object.keys(layers)) {
const sym = { x: [], y: [] };
const trail = { x: [], y: [] };
const lead = { x: [], y: [] };
for (const track of tracks) {
if (track.identity !== identity || !track.state || track.plots.length === 0) continue;
const s = track.state;
const last = track.plots[track.plots.length - 1];
const shown = s.coasting ? { bearing: toBearing(s.x, s.y), range: toRange(s.x, s.y) } : last;
sym.x.push(shown.bearing);
sym.y.push(shown.range);
if (ui.trailsInput.checked) {
for (const p of track.plots.slice(0, -1)) {
trail.x.push(p.bearing);
trail.y.push(p.range);
}
}
// A one-minute velocity leader, drawn as a few points so it stays straight on the polar chart
const h = (s.heading * Math.PI) / 180;
const sx = shown.range * Math.sin((shown.bearing * Math.PI) / 180);
const sy = shown.range * Math.cos((shown.bearing * Math.PI) / 180);
for (let k = 0; k <= 4; k++) {
const d = (s.speed / 60) * (k / 4);
lead.x.push(toBearing(sx + d * Math.sin(h), sy + d * Math.cos(h)));
lead.y.push(toRange(sx + d * Math.sin(h), sy + d * Math.cos(h)));
}
lead.x.push(NaN);
lead.y.push(NaN);
}
const layer = layers[identity];
layer.symbols.dataSeries.clear();
layer.symbols.dataSeries.appendRange(sym.x, sym.y);
layer.trails.dataSeries.clear();
layer.trails.dataSeries.appendRange(trail.x, trail.y);
layer.leaders.dataSeries.clear();
layer.leaders.dataSeries.appendRange(lead.x, lead.y);
}
labelData.clear();
if (ui.labelsInput.checked) {
for (const track of tracks) {
if (!track.state || track.plots.length === 0) continue;
const last = track.plots[track.plots.length - 1];
const s = track.state;
const text = track.contact.squawk
? `${track.contact.squawk}\nFL${String(s.flightLevel).padStart(3, "0")} ${s.speed}kt`
: `no SSR\n${s.speed}kt`;
// Place the data block a little up and to the right of the track (east and north on a north-up display)
const lx = last.range * Math.sin((last.bearing * Math.PI) / 180) + 1.6;
const ly = last.range * Math.cos((last.bearing * Math.PI) / 180) + 0.6;
labelData.append(toBearing(lx, ly), toRange(lx, ly), text);
}
}
}
// --- Tooltip and readout: the track under the mouse, or the range and bearing of the cursor ---
let lastMouse = null;
// The tooltip is an HTML card over the chart, placed next to the mouse
const tooltip = document.createElement("div");
tooltip.style.cssText =
"position:absolute; z-index:5; pointer-events:none; display:none; min-width:170px; padding:8px 10px;" +
"background:#0B1424EE; border:1px solid #FFFFFF33; border-left-width:4px; border-radius:6px;" +
"color:#E8EEF8; font:13px system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height:1.45;";
ui.chartDiv.append(tooltip);
function showTooltip(track, last) {
const s = track.state;
const identity = IDENTITIES[track.identity];
const rows = [
["Range", `${last.range.toFixed(1)} NM`],
["Bearing", `${pad3(last.bearing)}°`],
["Speed", `${s.speed} kt`],
["Heading", `${pad3(s.heading)}°`],
["Transponder", track.contact.squawk ? `${track.contact.squawk}, FL${String(s.flightLevel).padStart(3, "0")}` : "no reply"]
];
tooltip.style.borderLeftColor = identity.color;
tooltip.innerHTML =
`<div style="font-weight:700; color:${identity.color}">${identity.label.toUpperCase()}</div>` +
`<div style="margin-bottom:4px; color:#AFC0DC">${track.contact.name}, ${track.contact.kind === "surface" ? "surface" : "air"} track</div>` +
rows.map(([k, v]) => `<div style="display:flex; justify-content:space-between; gap:14px"><span style="color:#AFC0DC">${k}</span><b>${v}</b></div>`).join("") +
(s.coasting ? `<div style="margin-top:4px; color:#FFD166">Coasting: no echo on the last sweep</div>` : "");
// Beside the cursor, flipped to the other side near the right or bottom edge
const { x, y } = lastMouse.pixel;
const box = ui.chartDiv.getBoundingClientRect();
tooltip.style.display = "block";
const w = tooltip.offsetWidth;
const h = tooltip.offsetHeight;
tooltip.style.left = `${x + 16 + w > box.width ? x - 16 - w : x + 16}px`;
tooltip.style.top = `${Math.max(4, Math.min(y - h / 2, box.height - h - 4))}px`;
}
const defaultText = "Hover over a track for its identity, range, bearing, speed and heading.";
ui.readout.textContent = defaultText;
function showReadout() {
if (!lastMouse) {
tooltip.style.display = "none";
ui.readout.textContent = defaultText;
return;
}
const { bearing, range } = lastMouse;
const mx = range * Math.sin((bearing * Math.PI) / 180);
const my = range * Math.cos((bearing * Math.PI) / 180);
const pickRadius = (rangeAxis.visibleRange.max - rangeAxis.visibleRange.min) / 25;
let best = null;
for (const track of tracks) {
if (!track.state || track.plots.length === 0) continue;
const last = track.plots[track.plots.length - 1];
const tx = last.range * Math.sin((last.bearing * Math.PI) / 180);
const ty = last.range * Math.cos((last.bearing * Math.PI) / 180);
const d = Math.hypot(tx - mx, ty - my);
if (d < pickRadius && (!best || d < best.d)) best = { d, track, last };
}
if (!best) {
tooltip.style.display = "none";
ui.readout.textContent = `Cursor: range ${range.toFixed(1)} NM, bearing ${pad3(bearing)}°.`;
return;
}
showTooltip(best.track, best.last);
const { track, last } = best;
const s = track.state;
const id = IDENTITIES[track.identity].label;
const ssr = track.contact.squawk ? `squawk ${track.contact.squawk}, FL${String(s.flightLevel).padStart(3, "0")}` : "no transponder reply (primary radar only)";
const coast = s.coasting ? " Coasting: no echo on the last sweep." : "";
ui.readout.textContent =
`${id} ${track.contact.kind === "surface" ? "surface" : "air"} track (${track.contact.name.toLowerCase()}): range ${last.range.toFixed(1)} NM, ` +
`bearing ${pad3(last.bearing)}°, speed ${s.speed} kt, heading ${pad3(s.heading)}°, ${ssr}.${coast}`;
}
// A custom modifier turns the mouse position into bearing and range with the polar axes' own transforms
class RadarReadoutModifier extends CustomChartModifier2D {
// Tells the polar surface that this modifier works with polar charts
get modifierType() {
return EModifierType.Chart2DPolarModifier;
}
modifierMouseMove(args) {
super.modifierMouseMove(args);
const point = translateFromCanvasToSeriesViewRect(args.mousePoint, this.parentSurface.seriesViewRect);
if (!point) {
lastMouse = null;
} else {
const polar = bearingAxis.reverseTransform(point.x, point.y);
const bearing = (bearingAxis.getCurrentCoordinateCalculator().getDataValue(polar.x) + 360) % 360;
const range = rangeAxis.getCurrentCoordinateCalculator().getDataValue(polar.y);
// The mouse's position in the chart's div, in CSS pixels, to place the tooltip
const box = ui.chartDiv.getBoundingClientRect();
const pixel = { x: args.nativeEvent.clientX - box.left, y: args.nativeEvent.clientY - box.top };
lastMouse = range >= 0 && range <= MAX_RANGE_NM ? { bearing, range, pixel } : null;
}
showReadout();
}
modifierMouseLeave(args) {
super.modifierMouseLeave(args);
lastMouse = null;
showReadout();
}
}
sciChartSurface.chartModifiers.add(new RadarReadoutModifier());
// --- The key ---
ui.legend.innerHTML =
`<div style="font-weight:600; margin-bottom:4px">Identity</div>` +
Object.keys(IDENTITIES)
.map(
(id) =>
`<div style="display:flex; align-items:center; gap:6px; margin:3px 0">` +
`<img src="${drawSymbol(id, 22)}" width="18" height="18" alt="">${IDENTITIES[id].label}</div>`
)
.join("") +
`<div style="margin-top:8px; color:#c8d3e8">Dots: past plots (trail). Line: where the track will be in one minute.` +
` Labels: transponder code, flight level and ground speed. Simulated data.</div>`;
// --- The sweep: the antenna turns, each beam is refreshed as it passes, and everything else fades ---
let sweepCol = 0;
let elapsed = 0;
let lastTime = performance.now();
const fade = (seconds) => Math.exp(-seconds / PERSISTENCE_SECONDS);
function scanColumns(fromCol, toCol) {
const showClutter = ui.clutterInput.checked;
for (let k = fromCol; k < toCol; k++) {
const scan = Math.floor(k / AZIMUTHS) % LOOP_SCANS;
const col = k % AZIMUTHS;
if (col === 0 && scan === 0) {
rng = makeRandom(20261126); // the scenario starts again: clear the tracks
for (const track of tracks) {
track.plots = [];
track.state = null;
}
}
for (let row = 0; row < GATES; row++) {
const fresh = receive(col, row, scan, showClutter);
const old = video[row][col];
video[row][col] = Number.isNaN(old) ? fresh : Math.max(old * 0.3, fresh);
}
// Contacts whose bearing the beam is passing now get a new plot
for (const track of tracks) {
const p = positionAt(track.contact, scan + col / AZIMUTHS);
if (Math.floor(toBearing(p.x, p.y)) === col) plotContact(track, scan + col / AZIMUTHS);
}
}
}
// Run a few turns first, so the display already has tracks and trails when it appears,
// then fade each beam by how long ago the sweep passed it
const PREFILL = 9 * AZIMUTHS;
scanColumns(0, PREFILL);
for (let col = 0; col < AZIMUTHS; col++) {
const k = fade(((AZIMUTHS - col) / AZIMUTHS) * SWEEP_SECONDS);
for (let row = 0; row < GATES; row++) video[row][col] *= k;
}
sweepCol = PREFILL;
redrawTracks();
let sinceHeatmap = 0; // seconds since the heatmap was last sent to the chart
function animate(now) {
if (sciChartSurface.isDeleted) return; // stop when the chart is deleted
const dt = Math.min(now - lastTime, 100) / 1000;
lastTime = now;
elapsed += dt;
sinceHeatmap += dt;
// Performance: every heatmap update makes SciChart re-process the whole grid, however few cells changed.
// So the cheap parts (the sweep line and its glow) move every frame, and the heatmap (afterglow fade,
// new beams, tracks) is updated HEATMAP_UPDATES_PER_SECOND times a second. For large grids, use 15.
const angle = ((elapsed / SWEEP_SECONDS) * 360) % 360;
sweepData.clear();
sweepData.appendRange([angle, angle], [0, MAX_RANGE_NM]);
moveSweepWedge(angle);
if (sinceHeatmap >= 1 / HEATMAP_UPDATES_PER_SECOND) {
// Afterglow: every cell fades by the time since the last update
const k = fade(sinceHeatmap);
sinceHeatmap = 0;
for (let row = 0; row < GATES; row++) {
const line = video[row];
for (let col = 0; col < AZIMUTHS; col++) {
const v = line[col] * k;
line[col] = v < 0.012 ? NaN : v;
}
}
const targetCol = PREFILL + Math.floor((elapsed / SWEEP_SECONDS) * AZIMUTHS);
if (targetCol > sweepCol) {
scanColumns(sweepCol, targetCol);
sweepCol = targetCol;
redrawTracks();
}
videoData.setZValues(video);
showReadout();
}
requestAnimationFrame(animate);
}
ui.trailsInput.addEventListener("change", redrawTracks);
ui.labelsInput.addEventListener("change", redrawTracks);
requestAnimationFrame(animate);
import { SciChartReact } from "scichart-react";
import {
SciChartPolarSurface,
PolarNumericAxis,
EPolarAxisMode,
EPolarGridlineMode,
NumberRange,
EAutoRange,
PolarLineRenderableSeries,
PolarXyScatterRenderableSeries,
EllipsePointMarker,
XyDataSeries,
PolarMouseWheelZoomModifier,
PolarZoomExtentsModifier,
SciChartJsNavyTheme
} from "scichart";
const MAX_RANGE_NM = 60;
const SWEEP_SECONDS = 4;
// initChart builds the chart; SciChartReact creates it, sizes it and cleans it up
const initChart = async (rootElement: string | HTMLDivElement) => {
const { wasmContext, sciChartSurface } = await SciChartPolarSurface.create(rootElement, {
theme: new SciChartJsNavyTheme()
});
// Bearing: 0° at the top, clockwise. Range: circular gridlines are the range rings
sciChartSurface.xAxes.add(
new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
visibleRange: new NumberRange(0, 360),
autoRange: EAutoRange.Never,
startAngle: Math.PI / 2,
flippedCoordinates: true,
autoTicks: false,
majorDelta: 30,
labelPostfix: "°"
})
);
sciChartSurface.yAxes.add(
new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Radial,
visibleRange: new NumberRange(0, MAX_RANGE_NM),
autoRange: EAutoRange.Never,
startAngle: Math.PI / 2,
gridlineMode: EPolarGridlineMode.Circles,
autoTicks: false,
majorDelta: 10,
labelPostfix: " NM"
})
);
// The sweep line, and the tracks as bearing (x) and range (y) from your radar's track feed
const sweep = new XyDataSeries(wasmContext, { xValues: [0, 0], yValues: [0, MAX_RANGE_NM] });
const tracks = new XyDataSeries(wasmContext);
sciChartSurface.renderableSeries.add(
new PolarLineRenderableSeries(wasmContext, { dataSeries: sweep, stroke: "#D8FFE8", strokeThickness: 2 }),
new PolarXyScatterRenderableSeries(wasmContext, {
dataSeries: tracks,
pointMarker: new EllipsePointMarker(wasmContext, { width: 12, height: 12, fill: "#6CE07A40", stroke: "#6CE07A" })
})
);
sciChartSurface.chartModifiers.add(new PolarMouseWheelZoomModifier(), new PolarZoomExtentsModifier());
// Turn the sweep, and refresh the tracks the sweep has just passed
const start = performance.now();
let lastAngle = 0;
const animate = (now: number) => {
if (sciChartSurface.isDeleted) return;
const angle = (((now - start) / 1000 / SWEEP_SECONDS) * 360) % 360;
sweep.clear();
sweep.appendRange([angle, angle], [0, MAX_RANGE_NM]);
const { bearings, ranges } = getYourTracksBetween(lastAngle, angle);
if (bearings.length > 0) {
tracks.clear();
tracks.appendRange(bearings, ranges);
}
lastAngle = angle;
requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
return { sciChartSurface };
};
export const RadarDisplay = () => <SciChartReact initChart={initChart} style={{ width: "100%", height: 600 }} />;
import { Component } from "@angular/core";
import { ScichartAngularComponent } from "scichart-angular";
import {
SciChartPolarSurface,
PolarNumericAxis,
EPolarAxisMode,
EPolarGridlineMode,
NumberRange,
EAutoRange,
PolarLineRenderableSeries,
PolarXyScatterRenderableSeries,
EllipsePointMarker,
XyDataSeries,
PolarMouseWheelZoomModifier,
PolarZoomExtentsModifier,
SciChartJsNavyTheme
} from "scichart";
const MAX_RANGE_NM = 60;
const SWEEP_SECONDS = 4;
@Component({
selector: "app-radar-display",
standalone: true,
imports: [ScichartAngularComponent],
template: `<scichart-angular [initChart]="initChart" style="display: block; width: 100%; height: 600px"></scichart-angular>`
})
export class RadarDisplayComponent {
// initChart builds the chart; scichart-angular creates it, sizes it and cleans it up
initChart = async (rootElement: string | HTMLDivElement) => {
const { wasmContext, sciChartSurface } = await SciChartPolarSurface.create(rootElement, {
theme: new SciChartJsNavyTheme()
});
// Bearing: 0° at the top, clockwise. Range: circular gridlines are the range rings
sciChartSurface.xAxes.add(
new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
visibleRange: new NumberRange(0, 360),
autoRange: EAutoRange.Never,
startAngle: Math.PI / 2,
flippedCoordinates: true,
autoTicks: false,
majorDelta: 30,
labelPostfix: "°"
})
);
sciChartSurface.yAxes.add(
new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Radial,
visibleRange: new NumberRange(0, MAX_RANGE_NM),
autoRange: EAutoRange.Never,
startAngle: Math.PI / 2,
gridlineMode: EPolarGridlineMode.Circles,
autoTicks: false,
majorDelta: 10,
labelPostfix: " NM"
})
);
// The sweep line, and the tracks as bearing (x) and range (y) from your radar's track feed
const sweep = new XyDataSeries(wasmContext, { xValues: [0, 0], yValues: [0, MAX_RANGE_NM] });
const tracks = new XyDataSeries(wasmContext);
sciChartSurface.renderableSeries.add(
new PolarLineRenderableSeries(wasmContext, { dataSeries: sweep, stroke: "#D8FFE8", strokeThickness: 2 }),
new PolarXyScatterRenderableSeries(wasmContext, {
dataSeries: tracks,
pointMarker: new EllipsePointMarker(wasmContext, { width: 12, height: 12, fill: "#6CE07A40", stroke: "#6CE07A" })
})
);
sciChartSurface.chartModifiers.add(new PolarMouseWheelZoomModifier(), new PolarZoomExtentsModifier());
// Turn the sweep, and refresh the tracks the sweep has just passed
const start = performance.now();
let lastAngle = 0;
const animate = (now: number) => {
if (sciChartSurface.isDeleted) return;
const angle = (((now - start) / 1000 / SWEEP_SECONDS) * 360) % 360;
sweep.clear();
sweep.appendRange([angle, angle], [0, MAX_RANGE_NM]);
const { bearings, ranges } = getYourTracksBetween(lastAngle, angle);
if (bearings.length > 0) {
tracks.clear();
tracks.appendRange(bearings, ranges);
}
lastAngle = angle;
requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
return { sciChartSurface };
};
}
Key points:
- The display is a
SciChartPolarSurface. The angularPolarNumericAxisruns from 0 to 360° withstartAngle: Math.PI / 2andflippedCoordinates: true, so 000° is at the top and bearings increase clockwise like a compass. The radial axis usesEPolarGridlineMode.Circles, so its gridlines are the range rings. - The radar video is a
PolarUniformHeatmapRenderableSerieswith one cell per degree and half mile. Each frame multiplies every cell by a decay factor and the sweep writes fresh echoes into the cells it passes, which gives the afterglow. A colour map from transparent to bright green shows only the cells that are glowing. - Tracks are
PolarXyScatterRenderableSerieswith aSpritePointMarkerper identity, trails are a second scatter series, velocity lines and the coastline arePolarLineRenderableSeries, and data blocks are aPolarTextRenderableSeries. - The animation runs on
requestAnimationFrameand stops whensciChartSurface.isDeletedis true, so it ends cleanly when the chart is removed. A custom chart modifier converts the mouse position to bearing and range with the polar axes' own transforms for the readout.
See it in the demo app: JavaScript polar scatter chart · React polar scatter chart · Angular polar scatter chart, and for the radar video, JavaScript polar heatmap chart · React polar heatmap chart · Angular polar heatmap chart.
Go deeper: SciChart.js polar scatter chart documentation, the polar heatmap documentation, the polar text series documentation, and the antenna radiation pattern guide for the beam that sets a radar's bearing resolution. For how aerospace and defence software uses SciChart, see SciChart for aerospace and defence.
Frequently asked questions
What is a radar screen?
A radar screen, or radar display, shows what a radar has detected around it as a map seen from above. The radar is at the centre, the angle around the circle is the bearing from north, and the distance from the centre is the range. A sweep line turns with the antenna and refreshes each direction as it passes, and the echoes fade until the next sweep.
What is a spot on a radar screen called?
A spot of light on a radar screen is called a blip. It is the echo of the radar's pulse from an object such as an aircraft, a ship, a hill or a rain shower. On a modern display, the computer also turns the blips from several sweeps into a track, shown as a symbol with a trail and a label.
What do the circles on a radar screen mean?
The circles on a radar screen are range rings. Each one marks a fixed distance from the radar, such as every 10 nautical miles, so you can estimate how far away an echo is by counting rings. The scale around the edge gives the bearing, with 000 degrees at north on a north-up display.
What is the difference between primary and secondary radar?
Primary radar detects the echo of its own pulse from any object, so it sees aircraft, ships, birds and weather without their cooperation, but measures only range and bearing. Secondary radar interrogates aircraft transponders, which reply with an identity code and pressure altitude. Air traffic control uses both: primary for everything that reflects, secondary for identity and altitude.
Why does a radar screen have a sweeping line?
The sweeping line shows where the radar's antenna is pointing. A surveillance antenna has a narrow beam and turns continuously, so it sees one direction at a time. The display paints the echoes for each direction as the beam passes and lets them fade, so the picture is rebuilt once per rotation, every few seconds.
How do I make a radar display in JavaScript?
Use a polar chart with an angular axis from 0 to 360 degrees, starting at the top and running clockwise, and a radial axis for range with circular gridlines as range rings. Draw the sweep as a polar line, the radar video as a polar heatmap that fades each frame, and tracks as polar scatter points updated when the sweep passes them. SciChart.js does this with SciChartPolarSurface in plain JavaScript, React or Angular.
Sources
- Radar Basics: PPI-Scope, the radar mile, CFAR, tracking and sensitivity time control, C. Wolff, radartutorial.eu.
- Aeronautical Information Manual, chapter 4, section 5: Surveillance Systems and section 1: transponder operation and emergency codes, US Federal Aviation Administration. Primary and secondary radar, ADS-B and squawk codes. Also FAA Order 1812.8 for a long-range radar's 250 NM coverage and 12 s scan.
- Resolution MSC.192(79), Revised Performance Standards for Radar Equipment, International Maritime Organization (2004). Display orientation and motion modes, trails, target tracking, CPA and TCPA on ship radars.
- Stone, M. L. et al. (1989), Advances in primary-radar technology, The Lincoln Laboratory Journal, 2(3). An airport surveillance radar's 60 NM range and 4.8 s update, clutter maps, CFAR, moving target detection and circular polarisation against rain.
- US Department of Defense (2022), MIL-STD-2525E, Joint Military Symbology; NATO (2023), APP-6(E), NATO Joint Military Symbology. Standard identity frames and colours.