Code covered by the BSD License  

Highlights from
Plot Unit Vectors

Be the first to rate this file! 10 Downloads (last 30 days) File Size: 1.75 KB File ID: #28608
image thumbnail

Plot Unit Vectors

by James West

 

31 Aug 2010

Simple method to plot unit vectors in 3d

| Watch this File

File Information
Description

This function plots unitvectors X Y and Z or (e1, e2, e3) from an origin.
This function is fairly robust in that it can take 2 types of input. It can take a transformation matrix of the form
trMatrix = [1 0 0 0; pos' unitx' unity' unitz'] as:
fcn_plotUnitVectors(trMatrix).

Or it can take it as a combination of [1x3] vectors as:
fcn_plotUnitVectors(origin[1x3], csX[1x3], csY[1x3], csZ[1x3], vectorScale[1x1],colorSel)
colorSel can be a string used to format the vector as well.

The default coloring is
unit1 - red, unit2 - green, unit3 - blue

You can also set your own linestyles, for example:
if you have colorSel = ['''k'', ''LineWidth'', 5'] as the input, it will set the color to black and the thickness of the line to 5

Use: Easiest use is fcn_plotUnitVectors(trMatrix), however the vectorScale is not dynamic so it will need to be changed in the code if it doesn't suit your data.

MATLAB release MATLAB 7.9 (2009b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
3d James West 31 Aug 2010 12:13:17
vector James West 31 Aug 2010 12:13:17
plot3 James West 31 Aug 2010 12:13:17
unit vector James West 31 Aug 2010 12:13:17
display James West 31 Aug 2010 12:13:17
visualize James West 31 Aug 2010 12:13:17
transformation matrix James West 31 Aug 2010 12:13:17
quiver3 James West 31 Aug 2010 12:13:17

Contact us at files@mathworks.com