- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
| float hash (float2 n) | |
| { | |
| return frac(sin(dot(n, float2(123.456789, 987.654321))) * 54321.9876 ); | |
| } | |
| float noise(float2 p) | |
| { | |
| float2 i = floor(p); | |
| float2 u = smoothstep(0.0, 1.0, frac(p)); | |
| float a = hash(i + float2(0,0)); |
| // by davey whyte aka @beesandbombs | |
| void setup(){ | |
| size(600,520,P3D); | |
| colorMode(HSB,1); | |
| noStroke(); | |
| } | |
| float R = 160, r = 55; | |
| int N = 720; |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)