<commit_before>// Adapted/copied from https://code.google.com/p/polypartition/
/*
 * A point represents a vertex in a 2d environment.
 */
Point = function(x, y) {
  this.x = x;
  this.y = y;
}

Point.prototype.add = function(p) {
  return new Point(this.x + p.x, this.y + p.y);
}

Point.prototype.sub = function(p) {
  return new Point(this.x - p.x, this.y - p.y);
}

Point.prototype.mul = function(f) {
  return new Point(this.x * f, this.y * f);
}

Point.prototype.div = function(f) {
  return new Point(this.x / f, this.y / f);
}

Point.prototype.eq = function(p) {
  return (this.x == p.x && this.y == p.y);
}

Point.prototype.neq = function(p) {
  return (this.x != p.x || this.y != p.y);
}

Point.prototype.dot = function(p) {
  return (this.x * p.x + this.y * p.y);
}

//// POLY ////
Poly = function() {
  this.hole = false;
  this.points = null;
  this.numpoints = 0;
}

Poly.prototype.init = function(n) {
  this.points = new Array(n);
  this.numpoints = n;
}

Poly.prototype.triangle = function(p1, p2, p3) {
  this.init(3);<commit_msg>Add distance function to Point.<commit_after>// Adapted/copied from https://code.google.com/p/polypartition/
/*
 * A point represents a vertex in a 2d environment.
 */
Point = function(x, y) {
  this.x = x;
  this.y = y;
}

Point.prototype.add = function(p) {
  return new Point(this.x + p.x, this.y + p.y);
}

Point.prototype.sub = function(p) {
  return new Point(this.x - p.x, this.y - p.y);
}

Point.prototype.mul = function(f) {
  return new Point(this.x * f, this.y * f);
}

Point.prototype.div = function(f) {
  return new Point(this.x / f, this.y / f);
}

Point.prototype.eq = function(p) {
  return (this.x == p.x && this.y == p.y);
}

Point.prototype.neq = function(p) {
  return (this.x != p.x || this.y != p.y);
}

Point.prototype.dot = function(p) {
  return (this.x * p.x + this.y * p.y);
}

Point.prototype.dist = function(p) {
  var diff = this.sub(p);
  return Math.sqrt(diff.dot(diff))
}

//// POLY ////
Poly = function() {
  this.hole = false;
  this.points = null;
  this.numpoints = 0;
}

Poly.prototype.init = function(n) {
  this.points = new Array(n);
  this.numpoints = n;
}

Poly.prototype.triangle = function(p1, p2, p3) {
  this.init(3);
{'fraction_non_alphanumeric': 0.19131614654002713, 'fraction_numerical': 0.005427408412483039, 'mean_word_length': 2.8875219683655535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2832186', 'n_tokens_mistral': 908, 'n_tokens_neox': 893, 'n_words': 198}