Exemple #1
0
        public static capex.util.Vector2 multiplyVector(capex.util.Matrix33 a, capex.util.Vector2 b)
        {
            var x = a.v[0] * b.x + a.v[1] * b.y + a.v[2] * 1.00;
            var y = a.v[3] * b.x + a.v[4] * b.y + a.v[5] * 1.00;

            return(capex.util.Vector2.create(x, y));
        }
Exemple #2
0
        public static capex.util.Vector2 create(double x, double y)
        {
            var v = new capex.util.Vector2();

            v.x = x;
            v.y = y;
            return(v);
        }
Exemple #3
0
        public double distance(capex.util.Vector2 b)
        {
            var dist = (y - b.y) * (y - b.y) + (x - b.x) * (x - b.x);

            return(cape.Math.sqrt(dist));
        }
Exemple #4
0
 public capex.util.Vector2 multiply(capex.util.Vector2 b)
 {
     x *= b.x;
     y *= b.y;
     return(this);
 }
Exemple #5
0
 public capex.util.Vector2 subtract(capex.util.Vector2 b)
 {
     x -= b.x;
     y -= b.y;
     return(this);
 }
Exemple #6
0
 public capex.util.Vector2 add(capex.util.Vector2 b)
 {
     x += b.x;
     y += b.y;
     return(this);
 }