Azzera filtri
Azzera filtri

How does null function works?

11 visualizzazioni (ultimi 30 giorni)
Ana
Ana il 15 Ago 2013
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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by