solve on vector equation
显示 更早的评论
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 个评论
darova
2019-12-19
Do you have original equation?

Michiel Mathijs
2019-12-19
darova
2019-12-19
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
2019-12-20
采纳的回答
更多回答(1 个)
David Goodmanson
2019-12-21
编辑:David Goodmanson
2019-12-21
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
.
类别
在 帮助中心 和 File Exchange 中查找有关 Common Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
