<commit_before>class RiverSource {
  constructor(pos, heading){
    this.pos = pos;
    this.heading = heading;
    this.virtualTarget = p5.Vector.add(pos, createVector(20, 0).rotate(heading));
  }

  get x(){ return this.pos.x; }
  get y(){ return this.pos.y; }

  get end() { return this.pos; }

  draw(){
    noStroke();
    fill(200, 200, 50);
    ellipseMode(CENTER);
    ellipse(this.x, this.y, 10, 10);

    stroke(200, 200, 50);
    P5JsUtils.drawArrow(this.pos, this.virtualTarget);
  }
}<commit_msg>p5js/meandering-river - Refactor RiverSource data storage of heading<commit_after>class RiverSource {
  constructor(pos, heading){
    this.pos = pos;
    this.directionalVector = null;
    this.heading = heading;
  }

  set heading(newHeading){
    this._heading = newHeading;
    this.directionalVector = createVector(20, 0).rotate(newHeading);
  }
  }

  get x(){ return this.pos.x; }
  get y(){ return this.pos.y; }

  get end() { return this.pos; }

  draw(){
    noStroke();
    fill(200, 200, 50);
    ellipseMode(CENTER);
    ellipse(this.x, this.y, 10, 10);

    stroke(200, 200, 50);
    P5JsUtils.drawArrow(this.pos, p5.Vector.add(this.pos, this.directionalVector) );
  }
}
{'fraction_non_alphanumeric': 0.1550712489522213, 'fraction_numerical': 0.04274937133277452, 'mean_word_length': 3.2949640287769784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5442029', 'n_tokens_mistral': 481, 'n_tokens_neox': 431, 'n_words': 90}