# Show that three given vectors lie on a line, a plane, or span 3-space

Given three vectors, {2, 0, 0}, {0, 2, 2}, {2, 2, 3}, how could I see if they are all on the the same line, plane, or all of r3 in Mathematica? I can graph them all, like:

data = {{1, 2, 3}, {3, 4, 5}, {5, 6, 7}};
Graphics3D[Arrow[{{0, 0, 0}, #}] & /@ data]


but how can I say take two of them, draw a plane from them, and visually see the 3rd vector in relation to the plane?

• You want to do this visually or it's about linear algebra? If the former case than check RegionPlot3D and try to use it plot area that is perpendicular to the cross of two given vectors... unless they are parallel.
– Kuba
May 24 '14 at 18:57
• here, take a look: mathematica.stackexchange.com/q/1457/5478
– Kuba
May 24 '14 at 19:03
• If by "see" you mean "determine" then you can use MatrixRank. For your example, In:= MatrixRank[data] Out= 2 May 24 '14 at 19:11
• Yeah, I would like to be able to show it visually. May 24 '14 at 20:55
• Thanks Kuba. I saw that but didn't realize it was my answer! v1 = {2, 0, 0} v2 = {0, 2, 2} 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}], Arrow[{{0, 0, 0}, {2, 2, 2}}]}]}] May 24 '14 at 20:56

You can visually demonstrate that the vectors the vectors lie on a line in 3-space (and, a fortiori, are coplanar) by adding a line drawn from data[] to data[] to your Graphics expression.

With[{data = {{1, 2, 3}, {3, 4, 5}, {5, 6, 7}}},
Graphics3D[{Arrow[{{0, 0, 0}, #} & /@ data], Line[{data[], data[]}]}]] • But for assuring (visual) coplanarity two different perspectives would have to be shown, no? The image as shown above does not ensure coplanar vectors. May 25 '14 at 22:21
• @YvesKlett maybe but it's 3D, feel free to drag and rotate :)
– Kuba
May 27 '14 at 7:30
• @Kuba agreed. One way to automatically show coplanarity would be to choose the view direction parallel to the given plane ;-) May 27 '14 at 8:04