View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var grid = require('ctx-render-grid-lines')
var circle = require('ctx-circle')
var ndarray = require('ndarray')
var fillArray = require('ndarray-fill')
var marchingSquares = require('marching-squares')
var surfaceNets = require('surface-nets')
// where size is the bin size from 0..1
function createBinner(radius, width, height) {
View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var grid = require('ctx-render-grid-lines')
var circle = require('ctx-circle')
var ndarray = require('ndarray')
var fillArray = require('ndarray-fill')
// where size is the bin size from 0..1
function createBinner(radius, width, height) {
var cx = Math.ceil(width/radius)
View index.js
var fc = require('fc');
var center = require('ctx-translate-center');
var poly = require('ctx-render-polyline');
var points = require('ctx-render-points');
var circle = require('ctx-circle');
var bounds2 = require('2d-bounds');
var gridlines = require('ctx-render-grid-lines');
var isect = require('robust-segment-intersect');
var createSDF = require('sdf-polygon-2d');
var area = require('2d-polygon-area');
View index.js
var toPoly = require('pslg-to-poly')
var points = [
// loop 1
[-115, 100],
[ 103, 100],
[ 107, 50],
[-100, -100],
// loop 2
View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var min = Math.min;
var max = Math.max;
var abs = Math.abs;
function length(x, y) {
return Math.sqrt(x*x + y*y);
}
View add-math.h.patch
diff --git a/examples/opencl/histogram.cpp b/examples/opencl/histogram.cpp
index 4817efd..fb3c39b 100644
--- a/examples/opencl/histogram.cpp
+++ b/examples/opencl/histogram.cpp
@@ -18,6 +18,7 @@
#include <iterator>
#include <algorithm>
#include "cl_helpers.h"
+#include <math.h>
View index.js
var fc = require('fc')
var center = require('ctx-translate-center');
var circle = require('ctx-circle');
var ndarray = require('ndarray')
var vec2 = require('gl-vec2');
var createRay = require('ray-aabb');
function sign(a) {
return typeof a === 'number' ? a ? a < 0 ? -1 : 1 : a === a ? 0 : 0 : 0
}
View index.js
var fc = require('fc')
var center = require('ctx-translate-center');
var circle = require('ctx-circle');
var ndarray = require('ndarray')
var vec2 = require('gl-vec2');
var createRay = require('ray-aabb');
function sign(a) {
return typeof a === 'number' ? a ? a < 0 ? -1 : 1 : a === a ? 0 : 0 : 0
}
View index.js
var fc = require('fc')
var center = require('ctx-translate-center');
var circle = require('ctx-circle');
var ndarray = require('ndarray')
var vec2 = require('gl-vec2');
var createRay = require('ray-aabb');
var ro = [0, 0];
var rd = [0, 0];
var ray = createRay(ro, rd);
View gist:18f6801c2cb42467f693
[disabled optimization for 0x43c923f9b1 <SharedFunctionInfo SAR>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0x43c923eb41 <SharedFunctionInfo ADD>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0x43c923ef31 <SharedFunctionInfo SUB>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0x43c923f081 <SharedFunctionInfo MUL>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0x43c92892a1 <SharedFunctionInfo>, reason: TryCatchStatement]
[disabled optimization for 0x43c9285179 <SharedFunctionInfo FormatMessage>, reason: TryCatchStatement]
[marking 0x1524201eaa1 <JS Function SetFunctionName (SharedFunctionInfo 0x43c9242e29)> for recompilation, reason: hot and stable, ICs with typeinfo: 4/4 (100%), generic ICs: 0/4 (0%)]
[compiling method 0x1524201eaa1 <JS Function SetFunctionName (SharedFunctionInfo 0x43c9242e29)> using Crankshaft]
[optimizing 0x1524201eaa1 <JS Function SetFunctionName (SharedFunctionInfo 0x43c92