Skip to content

Instantly share code, notes, and snippets.

View Rantanen's full-sized avatar

Mikko Rantanen Rantanen

View GitHub Profile
@Rantanen
Rantanen / full.html
Last active August 29, 2015 14:19
Fast packing hexagon with circles
<!doctype HTML>
<html>
<head>
</head>
<body>
<h1>Packing hexagon with circles</h1>
<canvas id="canvas1" width="1000" height="800"></canvas>
<h1>Intermediate (u,v) coordinates</h1>
<canvas id="canvas2" width="1000" height="1000"></canvas>
<script>
var CustomError = function (msg, code) {
Error.call(this, msg);
this.code = code;
}
CustomError.prototype = Object.create(Error.prototype);
function throwError() {
throw new CustomError("Throwing custom error", 123);