How do you draw the plane on which two vectors lie?

SeedRandom[3];
{v1, v2} = RandomReal[{-2, 2}, {2, 3}];
n = Cross[v1, v2];
Show[{
  ContourPlot3D[n.{x, y, z} == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
    ContourStyle -> Opacity[0.5], Mesh -> False],
  Graphics3D[{Arrow[{{0, 0, 0}, v1}], Arrow[{{0, 0, 0}, v2}]}]
}]

Mathematica graphics


Here's an example of how you could do it:

v1 = {1, -1/2, -1.9}; (* pick something *)
v2 = {0, 1, -1}; (* pick something *)
r0 = {-1/2, 1/2, 3/4}; (* point in the plane; pick something *)

nn = Normalize[Cross[v1-r0, v2-r0]];
r = {rx, ry, rz};
sol = Solve[Dot[nn, (r - r0)] == 0, {rz}] // Simplify
Plot3D[rz /. sol, {rx, -10, 10}, {ry, -10, 10}]

enter image description here


Another option is to use Graphics3D primitives

Graphics3D[Polygon[{{0,0,0},v1,v1+v2,v2}]]

Edit

J.M. already gave one way to produce a square spanned by the two vectors as a Polygon. Another way would be to use Rotate:

{v1, v2} = RandomReal[{-1, 1}, {2, 3}]

Graphics3D[{
  Rotate[Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}],
    {{0, 0, 1}, Cross[v1, v2]}],
  Arrow[{{0, 0, 0}, v1}],
  Arrow[{{0, 0, 0}, v2}]}]

Mathematica graphics

Tags:

Graphics