Effacer les filtres
Effacer les filtres

Create cartesian unit vectors from 2 points

17 vues (au cours des 30 derniers jours)
Sebsatien
Sebsatien le 6 Août 2012
hi!
I've got two points in cartesian coordinates : (x,y,z) and (xo,yo,zo). I'd like to create ux, uy, uz, the unit vectors from these two points.
So, I did that:
Vx = [(x-x0)];
Vy = [(y-y0)];
Vz = [(z-zo)];
Ux = Vx./norm(Vx);
Uy = Vy./norm(Vy);
Uz = Vz./norm(Vz);
Is this right? Am I wrong?
thanks

Réponses (1)

bethel o
bethel o le 6 Août 2012
This is what I think it is:
d1=[2,3,6];
d0=[1,2,4];
nd=(d1-d0)./norm(d1-d0);%normalize
sum(nd.^2)%test normalized

Catégories

En savoir plus sur NaNs dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by