← Return to Learn Hub
Geospatial Engineering

Visualizing Global Cyber Attacks: Great-Circle Math & Canvas Threat Maps

By Keshav Kumar • Interactive Cartography & Web Graphics ‪ 8 min read • Last updated: November 2026

Security Operations Centers (SOCs) and film studios both love global cyber threat maps: glowing curved arcs launching across continents representing real-time malware telemetry and DDoS attacks. Here is the mathematics and graphics engineering behind them.

The Purpose of Cyber Attack Threat Maps

Leading cybersecurity vendors like Fortinet, Kaspersky, and Akamai popularised the live "pew pew" cyber attack map. While real-world network intrusions are discrete packet streams routed through undersea fiber-optic backbones, visualizing attacks as intercontinental missile-like ballistic arcs provides immediate spatial awareness for security analysts and executive stakeholders.

Building a high-performance threat map in a web browser requires bridging two distinct domains: geographical coordinate geometry (spherical coordinates) and 2D canvas curve rendering.

Step 1: Translating GPS Coordinates to 2D Mercator Space

Global attack telemetries define sources and targets by Latitude and Longitude. To draw these coordinates onto a flat computer display, we project spherical coordinates (where Latitude ranges from -90° to +90° and Longitude from -180° to +180°) onto a 2D Mercator plane:

function latLngToCanvasXY(lat, lng, canvasWidth, canvasHeight) {
    // Equirectangular / Standard Plate Carree projection
    const x = (lng + 180) * (canvasWidth / 360);
    const y = (90 - lat) * (canvasHeight / 180);
    return { x, y };
}

Step 2: Drawing Great-Circle Arcs with Quadratic Bezier Curves

Straight lines between cities look static and unnatural. In aviation and geospatial mapping, the shortest path between two points on a globe is a Great-Circle route. When projected onto a flat 2D map, these paths appear as elegant curved trajectories.

In HTML5 Canvas, we approximate these curves using a Quadratic Bezier curve (ctx.quadraticCurveTo). The control point is computed by calculating the midpoint between the origin and destination, then elevating it perpendicular to the travel vector proportional to the intercontinental distance:

function computeArcControlPoint(p1, p2) {
    const midX = (p1.x + p2.x) / 2;
    const midY = (p1.y + p2.y) / 2;
    const dist = Math.hypot(p2.x - p1.x, p2.y - p1.y);

    // Lift control point upward (negative Y in canvas space)
    const curveHeight = Math.min(dist * 0.45, 180);
    return {
        cx: midX,
        cy: midY - curveHeight
    };
}

Step 3: Animating Flying Attack Projectiles with Easing

A static curve indicates a connection, but an animated projectile conveys an active breach attempt. To animate a projectile traveling along a quadratic curve at progress t (where t ranges from 0.0 to 1.0), we apply the classic Bezier polynomial formula:

// Position on Quadratic Bezier at time t (0.0 to 1.0)
function getBezierXY(t, p0, cp, p1) {
    const oneMinusT = 1 - t;
    const x = oneMinusT * oneMinusT * p0.x + 2 * oneMinusT * t * cp.x + t * t * p1.x;
    const y = oneMinusT * oneMinusT * p0.y + 2 * oneMinusT * t * cp.y + t * t * p1.y;
    return { x, y };
}

Performance: Hitting 60 FPS Across 100 Cities

Rendering dozens of simultaneous arcs and hundreds of animated city nodes requires disciplined rendering loops. Key techniques include:

Equal Earth Projection & Client-Side Canvas 2D Bloom Pipeline

GEO VECTORS Natural Earth 50m TopoJSON Arc Quantize PROJECTION Equal Earth Math Parametric Slerp Arcs OFFSCREEN Background Canvas Pre-rendered Rim Light DYNAMIC 60FPS Packet Comets Additive Bloom Equal Earth Equation: x = (2 * �Z3 * λ * cos(ø)) / (3 * (9*A4*Θ^8 + 7*A3*Θ^6 + 3*A2*Θ^2 + A1)) & y = Έ * (A4*Θ^8 + A3*zay6 + A2*zh^2 + A1)

Authoritative References & Technical Sources

Launch Cyber Attack Threat Map

Experience our full-screen global threat map with 100 worldwide cities, live telemetry, and authentic attack trajectories.

Launch Simulator →