Using cross products to make an equation

3 views (last 30 days)
Tyler
Tyler on 12 Jun 2023
Moved: Torsten on 12 Jun 2023
I am wondering how I can take each part of a cross product so I can put it in an equation. For example, in matlab I determined that [3,-2,-3] x [2,4,-2] = [16,0,6]. But now I want to plug that into an equation where 16 is x, 0 is y, and 6 is z. Currently I am running into the problem where all three numbers are stuck together but is there a way to sepearate them into their x, y, and z components.

Answers (1)

Torsten
Torsten on 12 Jun 2023
Moved: Torsten on 12 Jun 2023
a = [3,-2,-3];
b = [2,4,-2];
[x y z] = my_cross(a,b)
x = 16
y = 0
z = 16
function [x y z] = my_cross(a,b);
xyz = cross(a,b);
x = xyz(1);
y = xyz(2);
z = xyz(3);
end

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!