Skip to content

Instantly share code, notes, and snippets.

View bmershon's full-sized avatar

Brooks Mershon bmershon

View GitHub Profile
@bmershon
bmershon / README.md
Last active November 14, 2016 03:29
Height Functions (Topology)

Copyright (c) 2014 Brooks Mershon

The MIT License - http://opensource.org/licenses/MIT

Please excuse the awful coding practices that may be found here.

This was more or less my first run at using D3 and JavaScript in an undergraduate math course (where writing code wasn't even expected, unless it was MATLAB). This was written before modular design, functional programming, and maturity had gripped the author to even a modest extent. This gadget (application seems too strong) was developed as if it were one colossal whiteboard exercise which permitted only small erasures and steady contributions over half of a semester.

The urge to go back and rearrange or modify in any way is strong, but I am choosing to leave this relic of sophomore year as a happy and messy memory of an assignment of which I am quite proud.

@bmershon
bmershon / README.md
Last active October 12, 2017 18:48
Vietoris-Rips Complex (simplicial complex)

Copyright (c) 2014 Brooks Mershon

The MIT License - http://opensource.org/licenses/MIT

Please excuse the awful coding practices that may be found here.

This was more or less my first run at using D3 and JavaScript in an undergraduate math course (where writing code wasn't even expected, unless it was MATLAB). This was written before modular design, functional programming, and maturity had gripped the author to even a modest extent. This gadget (application seems too strong) was developed as if it were one colossal whiteboard exercise which permitted only small erasures and steady contributions over half of a semester.

The urge to go back and rearrange or modify in any way is strong, but I am choosing to leave this relic of sophomore year as a happy and messy memory of an assignment of which I am quite proud.

@bmershon
bmershon / README.md
Last active September 18, 2016 03:27
Point Cloud Triangulation

One problem we encounter when we attempt to form the Rips-Complex of a point-cloud is over-triangulation.

If we naively form triangles for all unordered triples of points, we create a simplicial complex that is no-longer 2-dimensional. If, for example, we wish to count the number of 1-cycles in a rips-complex formed from a 2-dimensional point cloud, we need to be careful when we add triangles.

Rips-Complex shows this particular application.

Triangles appear when all of the edges for that triangle, the three 1-simplex faces, are present. These edges appear when the balls of radius r that expand around each point first touch. How do we know which edges we should form in

@bmershon
bmershon / README.md
Last active March 21, 2018 10:13
Holes in Sensor Networks

Sensor networks allow for regions to be scanned for the presence of a particular object. Many small devices, each capable of making some measurements, can be distributed over the desired region. The types of measurements a sensor might make include taking temperature readings, detecting electromagnetic frequencies, and recording sound levels. A more complex sensor could process video footage and find valuable information automatically.

A critical consideration for sensor networks is the “blanket” of coverage that is produced. Wherever holes exist in this coverage, it is possible to miss critical information in the region we would like to scan.

If we have sophisticated sensors capable of measuring their exact position, then it is a fairly easy task to compute the coverage of the network. However, if we have simple sensors which can only record local information, then we are

@bmershon
bmershon / README.md
Last active October 24, 2016 20:12
Orbits

The Forest Fire Sensor Network simulation required the senors to be in motion. What type of motion should be used? I considered the following:

  • Random Brownian Motion.
  • Wandering behavior as described by Craig Reynolds, which I first encountered a couple of years ago while reading Daniel Shiffman's Nature of Code
  • Predictable orbits resulting from sin and cosine functions

I decided to give the orbits approach a try. Dynamic sensor networks are interesting to visualize because the changing coverage of a region seems highly dependent on the underlying motion of the sensors. A predictable orbit for each sensor

@bmershon
bmershon / README.md
Last active November 26, 2016 22:48
squares

I wanted to make a looping animation after checking out the sweet work of Florian de Looij (@FloriandeLooij).

@bmershon
bmershon / .block
Last active December 12, 2017 17:03
Drink Blueprints
height: 768
width: 1050
border: no
license: gpl-3.0
@bmershon
bmershon / .block
Last active September 18, 2016 17:57
Nevada Wilderness
border: no
@bmershon
bmershon / README.md
Last active September 11, 2015 19:08
Convex Combination

A convex combination of three vectors in the plane allows us to represent any vector in the convex hull determined by those three vectors.

@bmershon
bmershon / README.md
Last active October 24, 2016 17:11
Context Sensitive Label Visibility

This was developed at the Washington Post as a prototype for an illustration about the devastating effects of U.S. nuclear testing carried out around the Marshall Islands. The purpose of this prototype was to demonstrate a means for showing geographic information what would otherise require many "small multiples" in a more dense, interactive, and perhaps intuitive way.

The use of context-senstive label placement that attempts to avoid cluttering the view with unecessary details was one of the most valuable design exercises involved in creating this graphic prototype.

SVG rendering is not performant enough for smooth mouse interaction of the 3D globe. The author's 2011 Mac Book Air, for example, manages a mere 11 frames per second as it performs the main update loop. Performance could be improved with more thoughtful managment of D3 4.0 selections as well as canvas rendering using the new D3 4.0 semantics for drawing paths.

N.B. Hex binning was performed using longitude and latitude: this produces a distor