solve on vector equation
Show older comments
Dear
i want to solve a vector equation to find the N vector. The equation is :
eq1 = nt/ni*cross(N,cross(-1*N,cv1))-N*sqrt(1-(nt/ni)^2*dot(cross(N,cv1),cross(N,cv1)))==[1;0;0];
Normal solve yields thre empty arrays>
Thanks in advance
With kind regards
4 Comments
darova
on 19 Dec 2019
Do you have original equation?

Michiel Mathijs
on 19 Dec 2019
darova
on 19 Dec 2019
Did you try fsolve?
eq1 = @(N) nt/ni*cross(N,cross(-1*N,cv1))-N*sqrt(1-(nt/ni)^2*dot(cross(N,cv1),cross(N,cv1))) - [1 0 0];
n1 = fsolve(eq1,[1 1 1]);
Michiel Mathijs
on 20 Dec 2019
Accepted Answer
More Answers (1)
David Goodmanson
on 21 Dec 2019
Edited: David Goodmanson
on 21 Dec 2019
Hi Michiel,
The unit vector N has to lie in the plane defined by s1 and s2. The result for any s1,s2 is
N = s2 - (n1/n2)*s1;
N = N/norm(N);
% have to determine whether N points in +N direction or -N direction
sgn = sign((n1/n2)*dot(s1,s2)-1);
N = sgn*N;
N has to lie in the plane defined by s1,s2 because from the bac-cab rule (letting n1/n2 = n12)
s2 = n12 (N x(-N x s1)) - N sqrt(...)
s2 = n12 (-N (N.s1) + s1) - N sqrt(...)
s2 - n12 s1 = -N ( n12 (N.s1) + sqrt(...) )
const N = s2 -n21 s1
.
Categories
Find more on Common Operations 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!