Ejemplo n.º 1
0
 public float CrossProduct(Vec2 rhs)
 {
     return((this.x * rhs.y) - (rhs.x * this.y));
 }
Ejemplo n.º 2
0
 public Vec2(Vec2 rhs)
 {
     Initialise(rhs.x, rhs.y);
 }
Ejemplo n.º 3
0
        //public Vec2 Normalize(Vec2 otherVec)
        //{
        //    float mag = otherVec.Magnitude();
        //    if (mag > 1)
        //    {
        //        float invmag = 1 / mag;

        //        return new Vec2(x * invmag, y * invmag);
        //    }
        //    return this;
        //}

        public float DotProduct(Vec2 rhs)
        {
            return((x * rhs.x) + (y * rhs.y));
        }