Box2DX.Common.Vec3.Cross C# (CSharp) Method

Cross() public static method

Perform the cross product on two vectors.
public static Cross ( Vec3 a, Vec3 b ) : Vec3
a Vec3
b Vec3
return Vec3
        public static Vec3 Cross(Vec3 a, Vec3 b)
        {
            return new Vec3(a.Y * b.Z - a.Z * b.Y, a.Z * b.X - a.X * b.Z, a.X * b.Y - a.Y * b.X);
        }

Usage Example

Exemplo n.º 1
0
        public Vec3 Solve33(Vec3 b)
        {
            float num = Vec3.Dot(this.Col1, Vec3.Cross(this.Col2, this.Col3));

            Box2DXDebug.Assert(num != 0f);
            num = 1f / num;
            return(new Vec3
            {
                X = num * Vec3.Dot(b, Vec3.Cross(this.Col2, this.Col3)),
                Y = num * Vec3.Dot(this.Col1, Vec3.Cross(b, this.Col3)),
                Z = num * Vec3.Dot(this.Col1, Vec3.Cross(this.Col2, b))
            });
        }
All Usage Examples Of Box2DX.Common.Vec3::Cross