n-dimensional cross product of vectors

Function calculates vector which is cross product of input column vectors. It supports calculation in n-dimensional space.
0 Downloads
Updated 11 May 2025

View License

Function calculates vector which is cross product of input column vectors. It supports calculation in n-dimensional space.
Input vectors are represented in matrix form. Number of vectors must be n-1, where n is number of dimensions of space.
example 1:
>> x = [1 2 4; 2 4 5; 6 0 0; 4 2 0] % 3 column vectors in 4d space
>> y = nDimCrossProduct(x)
y =
60
-48
-18
36
example 2: (if you prefer working with row-vectors)
>> data = [2 4 5; 1 4 0]
>> nDimCrossProduct(data')'
ans =
[ -20, 5, 4 ]

Cite As

Peter Krammer (2025). n-dimensional cross product of vectors (https://ch.mathworks.com/matlabcentral/fileexchange/181122-n-dimensional-cross-product-of-vectors), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0