Skip to content

Instantly share code, notes, and snippets.

@vasturiano
vasturiano / README.md
Last active October 9, 2026 10:26
Earth Satellites
@vasturiano
vasturiano / README.md
Last active September 23, 2026 06:11
ForceLink based Hierarchical Orbits

Attempt at simulation of multiple particles orbitting around each other in a hierarchical system (e.g. sun > planet > moon).

Uses D3 force-directed physics engine's forceLink to connect particles to their moving gravitational centers via fixed position anchor nodes.

The system fails to reach equilibrium due to the "spring" nature of forceLink, in which contrary to gravitational forces the intensity decreases with proximity, causing bodies to inevitably fall onto their attraction center. The forceMagnetic force is a better fit for modelling this type of motion.

Compare with the forceMagnetic version.

@vasturiano
vasturiano / README.md
Last active September 23, 2026 06:08
Binary Star System

A simulation of orbital trajectories using the d3-force simulation engine with the gravity-like d3-force-magnetic attraction force.

By default the layout represents a binary system. All the stars (red nodes) have the same mass and their attraction influence on the satellite (blue node) is proportional to the inverse-square of the distance. The stars are statically positioned and remain unaffected by either the satellite or other stars. Stars can be added and removed by double-clicking on canvas/nodes. All nodes can also be repositioned by dragging.

The initial velocity (and direction) of the satellite can be changed using the controls on the top-right. The length of the pre-estimated trajectory can be manipulated by changing the number of samples (represented as dots).

See also Single Orbital Trajectory.

@vasturiano
vasturiano / README.md
Last active September 23, 2026 06:07
3D Radial Force

3D version of mbostock's Radial Force.

The two classes of nodes are attracted to a sphere's surface with configured radius of 300px (red) and 600px (blue).

Uses 3d-force-graph for the ThreeJS/WebGL rendering and d3-force-3d for the 3D versions of the radial and collision forces.

@vasturiano
vasturiano / .block
Last active June 10, 2026 12:56
Hilbert Map of Autonomous System Numbers (ASn) allocations
license: mit
scrolling: yes
@vasturiano
vasturiano / .block
Last active June 10, 2026 12:56
Hilbert Map of IPv6 address space
license: mit
@vasturiano
vasturiano / .block
Last active June 10, 2026 12:56
Hilbert Map of IPv4 address space
license: mit
@vasturiano
vasturiano / .block
Last active March 27, 2026 15:01
Timelines Chart
height: 700
scrolling: yes
@vasturiano
vasturiano / README.md
Last active January 21, 2026 09:16
Geostationary Satellites

Representation of the motion of Geosynchronous artificial satellites orbiting the Earth.

Geosynchronous satellites follow a circular orbit around the Earth at a distance of approximately 35,786km above the surface. A large amount of these satellites are fully Geostationary, lining up very closely with the Earth's equator. Others diverge from this single perimeter line and wave around the equatorial plane with a period equal to a sidereal day (~23h56m4s).

Each satellite is projected at the location on Earth where it's directly at the zenith. Time is accelerated to 5min/frame to highlight the daily motion.

Data provided by Space Track in TLE format, propagated to space-time coordinates using satellite-js.

Solar termi

@vasturiano
vasturiano / .blocks.json
Last active October 24, 2025 10:48
VR Force-Directed Graph
{"nodes":[{"id":"4062045","user":"mbostock","description":"Force-Directed Graph"},{"id":"1341021","user":"mbostock","description":"Parallel Coordinates"},{"id":"1341281","user":"jasondavies","description":"Parallel Coordinates"},{"id":"b3ff6ae1c120eea654b5","user":"d3noob","description":"Simple d3.js Graph"},{"id":"4963004","user":"calvinmetcalf","description":"Quadtree Madness Round 2"},{"id":"4962892","user":"calvinmetcalf","description":"Quadtree Madness Round 2"},{"id":"4963273","user":"calvinmetcalf","description":"Quadtree Madness Round 2"},{"id":"4967213","user":"calvinmetcalf","description":"Rtree Madness"},{"id":"4060606","user":"mbostock","description":"Choropleth"},{"id":"4686432","user":"dwtkns","description":"Faux-3d Shaded Globe"},{"id":"3757101","user":"mbostock","description":"Lambert Azimuthal Equal-Area"},{"id":"5028304","user":"d3noob","description":"Sankey diagram with horizontal and vertical node movement"},{"id":"4343214","user":"mbostock","description":"Quadtree"},{"id":"1346410","user"