How does null function works?
11 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I'm doing a project in which I have to find the circle that describes the intersection of 2 spheres. I found in the internet a cool matlab algorithm that works really well but I don't understand how it works.
Let C1 = [x1,y1,z1] and C2 = [x2,y2,z2] be two row vectors defining the spheres' centers and r1 and r2 their respective radii.
C21 = C2-C1;
d2 = dot(C21,C21);
C0 = (C1+C2)/2+(r1^2-r2^2)/(2*d2)*C21;
R = sqrt(((r1+r2)^2-d2)*(d2-(r2-r1)^2)/(4*d2));
N = null(C21).';
T = linspace(0,2*pi).';
V = bsxfun(@plus,C0,R*[cos(T),sin(T)]*N);
In particular, I would like to understand how does the null function works.
I understand what is the result if I use the function as null(matrix,'r') but if I use null(matrix) I don't understand what it does.
I hope I have explained myself well. Thanks for your help ;)
Ana
0 个评论
采纳的回答
Matt J
2013-8-15
编辑:Matt J
2013-8-15
I understand what is the result if I use the function as null(matrix,'r') but if I use null(matrix) I don't understand what it does.
The difference between null(matrix,'r') and null(matrix) is that the latter produces an orthonormal basis for the null space, whereas you may not get orthonormality from null(matrix,'r').
2 个评论
Matt J
2013-8-15
There are some steps. You can view the contents of null.m by doing
>>type null
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!