필터 지우기
필터 지우기

How does null function works?

조회 수: 11 (최근 30일)
Ana
Ana 2013년 8월 15일
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

채택된 답변

Matt J
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
Ana
Ana 2013년 8월 15일
Thanks for you answer, but do you know how exactly are the calculations done?
Matt J
Matt J 2013년 8월 15일
There are some steps. You can view the contents of null.m by doing
>>type null

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by