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!