Ask Your Question
0

define new vector

asked 2015-03-16 03:15:30 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

hi i'm new in sage , I have two vectors

v1=vector([8,-10,12])
v2=vector([9,4,-6])

i want to create a third one which is parallel with v1 and also the scalar product of v2 and v3 is equal to 1440

(x,y,z)=var('x,y,z')
v3=vector([x,y,z])

solve([v1.dot_product(v3)==1440,v2.cross_product(v3)==0],x,y,z)

i want to get something like this: [x= , y= , z= ]
but the result: []

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-16 09:32:08 +0100

nbruin gravatar image

Vectors with symbolic entries are not themselves "symbolic", so you can't put them in places where symbolic equations are expected:

sage: v2.cross_product(v3)==0
False

You can work around that, though:

sage: solve(v2.cross_product(v3).list() + [v1.dot_product(v3)==1440],x,y,z)
[[x == -324, y == -144, z == 216]]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-03-16 03:15:30 +0100

Seen: 366 times

Last updated: Mar 16 '15