<commit_before>import * as ko from "knockout";

function calcAngle(point1, point2) {
  let dx = point1.x() - point2.x();
  let dy = point1.y() - point2.y();
  let angle = Math.atan(dy / dx) * (180 / Math.PI);
  return dx < 0 ? angle - 180 : angle;
}

class Arc {
  constructor(endA, endB) {
    this.endA = endA;
    this.endB = endB;

    // The angle of the arc, measured as the angle from the
    // vertical line extending downwards from end A
    let angle = ko.pureComputed(() =>
      calcAngle(this.endA.point(), this.endB.point()));
<commit_msg>Replaced atan with atan2<commit_after>import * as ko from "knockout";

function calcAngle(point1, point2) {
  const dx = point1.x() - point2.x();
  const dy = point1.y() - point2.y();
  return Math.atan2(dy, dx) * (180 / Math.PI);
}

class Arc {
  constructor(endA, endB) {
    this.endA = endA;
    this.endB = endB;

    // The angle of the arc, measured as the angle from the
    // horizontal line extending eastwards from end B
    const angle = ko.pureComputed(() =>
      calcAngle(this.endA.point(), this.endB.point()));

{'fraction_non_alphanumeric': 0.1458910433979686, 'fraction_numerical': 0.0221606648199446, 'mean_word_length': 2.970695970695971, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '2590089', 'n_tokens_mistral': 393, 'n_tokens_neox': 377, 'n_words': 114}