Generate an Orthogonal Set of Unit Vectors
Ex 1:
z_in = [0 0 5]';
[x, y, z] = orthogonal_set(z_in);
Supplied with the z axis, two perpendicular unit vectors are created in the xy plane.
Ex 2:
n = [1 -2 5]';
[x, y, z] = orthogonal_set(n);
Supplied with a normal vector, the returned orthogonal set of unit vectors will have a z vector parallel to the normal and an x and y vector that can be used to describe the plane that has n as a normal.
Test Scripts:
t_orthogonal_set.m - unit test the function and ensure the resulting vectors are a correct orthogonal set
t_show_me.m - A quick script that generates the screenshot image
Citation pour cette source
Dan Couture (2026). Generate an Orthogonal Set of Unit Vectors (https://fr.mathworks.com/matlabcentral/fileexchange/37794-generate-an-orthogonal-set-of-unit-vectors), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
orthogonal_set/
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 |
