View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Generate an Orthogonal Set of Unit Vectors

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 32.1 KB File ID: #37794 Version: 1.0
image thumbnail

Generate an Orthogonal Set of Unit Vectors


Dan Couture (view profile)


Given a vector, a set of orthogonal unit vectors is calculated to use as rotated coordinate axes.

| Watch this File

File Information

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

Required Products MATLAB
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us