1 | initial version |
I am not sure how "canonical" it is, but i would do the following:
For your first question, satisfying an equatiion corresponds to gelonging to some kernel:
sage: M = matrix(QQ,[[1,2,3,]])
sage: M.right_kernel()
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1/3]
[ 0 1 -2/3]
sage: M.right_kernel().basis()
[
(1, 0, -1/3),
(0, 1, -2/3)
]
So, the set of vectors that satifsfy ax+by+cz=0
are the t_1 * (1, 0, -1/3) + t_2 * (0, 1, -2/3)
for t_1
and t_2
in QQ
.
For your second question, you can do:
sage: v1 = vector(QQ,(1,2,3))
sage: v2 = vector(QQ,(4,5,6))
sage: V = span([v1,v2],QQ) ; V
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1]
[ 0 1 2]
sage: vector((5,7,9),QQ) in V
True