Plot Vector using Plot3
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi guys,
I've calculated a vector using the cross product of 2 vectors and am curious how I can input this so that I can draw a plot.
How can I input it in a way that my i, j and k values will correspond to x, y and z values?
Thanks for any help
0 comentarios
Respuestas (2)
Tom
el 13 de Mzo. de 2012
Since vectors aren't really tied to points, you need to first specify a starting point for your vectors. If you want them to have common point, say (a,b,c). I would then construct x, y, z coordinate vectors like
x = i*t + a
y = j*t + b
z = k*t + c
where t is the parameter of the parametrized equations; it determines the length of your vectors. All that's left is plotting x, y and z.
Tom
el 14 de Mzo. de 2012
I would set t=0:0.05:1;, for instance.
I was thinking of using the hold function when plotting. Without it I would think you would have to be smart about the order that you plot the points (the order of the arrays). But if it looks like it's working (and is correct), it probably is. The length of the cross product always tends to be larger than the initial vectors. I would just divide the entire resultant vector by a factor of 2 or 3, whatever looked better.
2 comentarios
Walter Roberson
el 17 de Mzo. de 2012
annotation() can be used to plot arrows.
http://www.mathworks.com/help/techdoc/creating_plots/f0-33318.html
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!