class Vector2 {
  constructor (x,y) {
    this.x = x;
    this.y = y;  
  }
  magnitude () {
    return Math.sqrt(Vector2.dot(this, this));
  }
  bipolarMag () {
    var mag = this.magnitude();
    if(this.x + this.y > 0) {
        return mag - 1;
    } else {
      return mag*-1 + 1;
    }
  }
  normalize () {
    var m = 1/this.magnitude();
    if(m == Infinity) {
      m = 0;
    }
    this.x = this.x * m;
    this.y = this.y * m;
  }
  multiply(scaler) {
    this.x = this.x * scaler;
    this.y = this.y * scaler;
  }
  add (v) {
    this.x = this.x + v.x;
    this.y = this.y + v.y;
  }
  subract(v) {
    var n = new Vector2(v.x, v.y);
        n.negate();
    this.add(m);
  }
  divide(scaler) {
    scaler = 1/scaler;
    this.multiply(scaler)
  }
  negate() {
    this.x = -this.x;
    this.y = -this.y;
  }
  clamp (limit) {
    if (this.x > limit) {
      this.x = limit;
    }
    if (this.y > limit) {
      this.y = limit;
    }
  }
  rotate (degrees) {
        var rads = Vector2.degreesToRadians(degrees);
        var cosineAngle = Math.cos(rads);
        var sineAngle   = Math.sin(rads);
        console.log(cosineAngle, sineAngle)
        this.x = cosineAngle*this.x - sineAngle*this.y;
        this.y = sineAngle*this.x + cosineAngle*this.y;
  } 
  static radiansToDegrees(radians) {
    return radians * (180 / Math.PI);
  }
  static degreesToRadians(degrees) {
    return degrees * (Math.PI / 180);
  }
  static angleBetween(a, b) {
      return Math.atan2(b.y - a.y, b.x - a.x);
  }
  static lerp (a, b, t) {
    var x = a.x + t * (b.x - a.x);
    var y = a.y + t * (b.y - a.y);
    return new Vector2(x,y); 
  }
  static normalize (a) {
    var m = 1/a.magnitude();
    if(m == Infinity) {
      m = 0;
    }
    return new Vector2(a.x * m, a.y * m);
  }
  increase(amount) {
    this.x = this.x + amount;
    this.y = this.y + amount;
  }
    decrease(amount) {
    this.x = this.x - amount;
    this.y = this.y -amount;
  }
  static add (a, b) {
    return new Vector2((a.x + b.x),(a.y + b.y));   
  }
  static subtract (a, b) {
    var n = new Vector2(b.x, b.y);
        n.negate();
    return Vector2.add(a, n);  
  }
  static multiply (a, scaler) {
    return new Vector2((a.x * scaler),(a.y * scaler));   
  }  
  static divide (a, scaler) {
    scaler = 1/scaler;
    return multiply(a, scaler);
  }  
  static dot (a, b) {
     return a.x * b.x + a.y * b.y;
  }
  static dist (a, b) {
    var vec1 = a.x - b.x;
    var vec2 = a.y - b.y;
    return Math.sqrt((vec1 * vec1)+(vec2 * vec2));
  }
  get () {
    return new Vector2(this.x, this.y);
  }
  set (x,y) {
    this.x = x;
    this.y = y;
  }
}

class Mover {
  constructor(x,y) {
      this.location = new Vector2(x,y);
      this.acceleration = new Vector2(0,0);
      this.velocity = new Vector2(0,0);
      this.mass = 5;
  } 
  applyForce(force) {
    var f = force.get(); 
        f.divide(this.mass);
    this.acceleration.add(f);
  }
  update () {
    this.velocity.add(this.acceleration);
    this.location.add(this.velocity);
    this.acceleration.set(0,0);
  }
}

class Attractor {
  constructor(x,y) {
    this.mass = 100;
    this.location = new Vector2(x,y);
  }
  attract(m) {
    // not implemented
  }
}
@@ -889,55 +889,341 @@
    %7D
-%0A    if (this.y %3E limit) %7B%0A      this.y = limit
+ else if ( this.x %3C 0 && this.x %3C limit) %7B%0A      this.x = -limit;%0A    %7D%0A    if (this.y %3E limit) %7B%0A      this.y = limit;%0A    %7Delse if (this.y %3C 0 && this.y %3C limit) %7B%0A      this.y = -limit;%0A    %7D%0A  %7D%0A  limit (limit) %7B%0A    var magnitude = this.magnitude();%0A    if(magnitude %3E limit) %7B%0A      this.normalize();%0A      this.multiply(limit)
 ;%0A  
@@ -1393,52 +1393,8 @@
 s);%0A
-        console.log(cosineAngle, sineAngle)%0A
     
@@ -2902,24 +2902,46 @@
 ctor(x,y) %7B%0A
+      this.angle = 0;%0A
       this.l
@@ -3318,24 +3318,514 @@
 ,0);%0A  %7D%0A%7D%0A%0A
+class Vehicle extends Mover %7B%0A  constructor(x,y) %7B%0A      super(x,y);%0A      this.maxSpeed = 10;%0A      this.maxForce = 0.25;%0A  %7D %0A  seek(target) %7B%0A    var desired = Vector2.subtract(target, this.location);%0A        desired.normalize();%0A        desired.multiply(this.maxSpeed);%0A    var steer = Vector2.subtract(desired, this.velocity);%0A        steer.limit(this.maxForce);%0A    this.applyForce(steer);%0A    this.angle = Vector2.radiansToDegrees(Vector2.angleBetween(steer, this.velocity));%0A  %7D%0A%7D%0A%0A
 class Attrac

correct clamping and limiting. added vehicle class