<commit_before>#pragma once

#include "../util.hpp"

using ld = long double;
using Point = complex<ld>;
using Polygon = vector<Point>;

const ld eps = 1e-9;

ld dot(Point a, Point b) { return real(conj(a) * b); }
ld cross(Point a, Point b) { return imag(conj(a) * b); }

struct Line {
  Point a, b;
  Line (Point p, Point q) : a(p), b(q) {;}
};

struct Segment {
  Point a, b;
  Segment (Point p, Point q) : a(p), b(q) {;}
};

struct Circle {
  Point p; ld r;
  Circle (Point a, ld b) : p(a), r(b) {;}
};

Line to_line(Segment s) { return Line(s.a, s.b); }
Segment to_segment(Line l) { return Segment(l.a, l.b); }

// counter clockwise
int ccw (Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > eps) return 1;   // counter clockwise
  if (cross(b, c) < -eps) return -1; // clockwise
  if (dot(b, c) < 0) return 2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line
  return 0;<commit_msg>deprecated to_segment<commit_after>#pragma once

#include "../util.hpp"

using ld = long double;
using Point = complex<ld>;
using Polygon = vector<Point>;

const ld eps = 1e-9;

ld dot(Point a, Point b) { return real(conj(a) * b); }
ld cross(Point a, Point b) { return imag(conj(a) * b); }

struct Line {
  Point a, b;
  Line (Point p, Point q) : a(p), b(q) {;}
};

struct Segment {
  Point a, b;
  Segment (Point p, Point q) : a(p), b(q) {;}
};

struct Circle {
  Point p; ld r;
  Circle (Point a, ld b) : p(a), r(b) {;}
};

Line to_line(Segment s) { return Line(s.a, s.b); }

// counter clockwise
int ccw (Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > eps) return 1;   // counter clockwise
  if (cross(b, c) < -eps) return -1; // clockwise
  if (dot(b, c) < 0) return 2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line
  return 0;
{'fraction_non_alphanumeric': 0.19110378912685339, 'fraction_numerical': 0.008786381109280615, 'mean_word_length': 2.827731092436975, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '1971393', 'n_tokens_mistral': 775, 'n_tokens_neox': 756, 'n_words': 256}