Plot Series of 3D Direction Vectors (Not All from Origen)

i like this post (click again to cancel)
0
i dont like this post (click again to cancel)

Hi,

I'm trying to plot a series of vectors. I've pasted what I have below. The problem is that I want to plot the second vector, starting from the end of the first vector. If I run the commands below, I get two vectors plotted as I want (with arrows) but they are both from the origin.

I tried looking at MATPLOTLIB to see what to do but I got stuck.

Is there an easy way to plot a series of vectors in the way that I want?

a=vector([1,1,1])
b=vector([2,2,3])
aPlot=plot(a, legend_label='Vector a')
bPlot=plot(b, legend_label='Vector b')
AllPlot=aPlot+bPlot
AllPlot.show()

asked Jul 22 '12

Justin1 gravatar image Justin1
21 1 1 6

updated Jul 22 '12

calc314 gravatar image calc314
1820 3 19 51

2 Answers:

i like this answer (click again to cancel)
2
i dont like this answer (click again to cancel)
sage: a1=arrow((0,0,0), (1,1,1))
sage: a2=arrow((1,1,1), (2,2,3))
sage: a3=arrow((2,2,3), (3,3,1))
sage: a1+a2+a3
link

posted Jul 22 '12

achrzesz gravatar image achrzesz
1661 4 16 36

Thanks very much!

Justin1 (Jul 22 '12)

The point being of course that a vector "always" starts at the origin, though some books would disagree.

kcrisman (Jul 23 '12)
i like this answer (click again to cancel)
2
i dont like this answer (click again to cancel)

You can use the start keyword to give a starting point or vector:

a=vector([1,1,1])
b=vector([-1,2,3])
plot(a)+plot(b, start=a)
link

posted Jul 24 '12

Jason Grout gravatar image Jason Grout
3185 7 27 71

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Tags:

Stats:

Asked: Jul 22 '12

Seen: 196 times

Last updated: Jul 24 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.