ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 13 Sep 2013 23:26:09 -0500add a plane defined by two vectorshttps://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/I have a set of three vectors
p1 = vector([1,-0.5,0]) # eigenvector of eigenvalue 2
p2 = vector([0,0,1]) # eigenvector of eigenvalue 2
c = vector([1,-1,0]) # eigenvector of eigenvalue 3
plot(p1, color = "red") + plot(p2, color = "red") + plot(c)
Vectors `p1` and `p2` form a plane since they come from the same eigenvalue. How would I add a plane defined by these two vectors?Fri, 13 Sep 2013 09:30:40 -0500https://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/Answer by calc314 for <p>I have a set of three vectors</p>
<pre><code>p1 = vector([1,-0.5,0]) # eigenvector of eigenvalue 2
p2 = vector([0,0,1]) # eigenvector of eigenvalue 2
c = vector([1,-1,0]) # eigenvector of eigenvalue 3
plot(p1, color = "red") + plot(p2, color = "red") + plot(c)
</code></pre>
<p>Vectors <code>p1</code> and <code>p2</code> form a plane since they come from the same eigenvalue. How would I add a plane defined by these two vectors?</p>
https://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/?answer=15451#post-id-15451You can use the `polygon` command as follows:
p1 = vector([1,-0.5,0]) # eigenvector of eigenvalue 2
p2 = vector([0,0,1]) # eigenvector of eigenvalue 2
c = vector([1,-1,0]) # eigenvector of eigenvalue 3
q=plot(p1, color = "red") + plot(p2, color = "red") + plot(c)
q+=polygon([[0,0,0],p1,p1+p2,p2],opacity=0.5,color="red")
show(q)Fri, 13 Sep 2013 15:32:34 -0500https://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/?answer=15451#post-id-15451Comment by Roman LuĀtrik for <p>You can use the <code>polygon</code> command as follows:</p>
<pre><code>p1 = vector([1,-0.5,0]) # eigenvector of eigenvalue 2
p2 = vector([0,0,1]) # eigenvector of eigenvalue 2
c = vector([1,-1,0]) # eigenvector of eigenvalue 3
q=plot(p1, color = "red") + plot(p2, color = "red") + plot(c)
q+=polygon([[0,0,0],p1,p1+p2,p2],opacity=0.5,color="red")
show(q)
</code></pre>
https://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/?comment=17015#post-id-17015After asking this question, I came across this post (http://ask.sagemath.org/question/1503/save-3d-plot-as-vector-format) and lo and behold, `polygon` saves the day after all.Fri, 13 Sep 2013 23:26:09 -0500https://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/?comment=17015#post-id-17015