VBA for Cross Products in Excel

Use Application.Transpose:

Function vCP(v1 As Variant, v2 As Variant) As Variant

vCP = Application.Transpose(Array(v1(2) * v2(3) - v1(3) * v2(2), _
v1(3) * v2(1) - v1(1) * v2(3), _
v1(1) * v2(2) - v1(2) * v2(1)))
End Function

Leave a Comment

tech