solve on vector equation
Mostrar comentarios más antiguos
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 comentarios
darova
el 19 de Dic. de 2019
Do you have original equation?

Michiel Mathijs
el 19 de Dic. de 2019
darova
el 19 de Dic. de 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
el 20 de Dic. de 2019
Respuesta aceptada
Más respuestas (1)
David Goodmanson
el 21 de Dic. de 2019
Editada: David Goodmanson
el 21 de Dic. de 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
.
Categorías
Más información sobre Common Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
