In my linear algebra course in university we started learning about span and I was curious what is it good for? and if someone know, how does it relate to 3D graphics?
Thank you.
In my linear algebra course in university we started learning about span and I was curious what is it good for? and if someone know, how does it relate to 3D graphics?
Thank you.
Given a set of vectors, what can you do with them? Well, by the axioms of a vector space, you can add and subtract, or multiply by a scalar -- and this is exactly what the span of a set of vectors is! You're given a list of vectors, and told "Here you go! You can only play with these vectors. See what you can make with them." The set of all things you can make is the span of those vectors.
That the span is a subspace is nice -- it's always good to have objects that are closed under certain operations, and subspaces are just that: closed under vector addition and scalar multiplication. Adding or subtracting linear combinations, or multiplying them by a scalar, is yet another linear combination. This isn't true for most generic sets of vectors, but definitely true for the span of a set of vectors. So, spans generally behave in a nice way, nicer than the set of vectors you started with.
The span of a set of vectors is a the subspace generated by these vectors. This is an inherently useful object. This has also immediate geometric meaning.
The span of a vector $v$ is exactly the line through the origin in direction $v$.
For two vectors $v,w$, not co-linear, the span is the plane containing the origin "spanned" by $v$ and $w$, that is containing the line in direction $v$ and the line in direction $w$.
"Span" can be thought of as a way to formalize the concept of a coordinate system.
There are many situations in geometry, physics, etc. where one needs to set up a coordinate system determined by two vectors $\vec v,\vec w$ that play the role of the unit $x$ and $y$-vectors.
Now ask yourself: what is the relation between the two vectors $\vec v,\vec w$ and the set of vectors in the coordinate system?
Answer: the set of vectors in the coordinate system is the span of $\vec v$ and $\vec w$.
Why is this true? Draw a picture of the coordinate system, with origin $O$ where the $\vec v$ and $\vec w$ axes cross each other; choose a coordinate $s$ on the axis in the $\vec v$ direction; choose a coordinate $t$ on the axis in the $\vec w$ direction; draw the usual picture that we learn in precalculus for locating the point $P(s,t)$ in this coordinate system. And then observe: the vector $OP$ is precisely the linear combination $$s \vec v + t \vec w $$ As you vary the choice of $s,t$, you get $$\text{Span}(\vec v,\vec w) = \{s \vec v + t \vec w \, \bigm| \, s,t \in \mathbb{R}\} $$
Roughly, the span of a set of vectors is the set of points in the vector space which can be reached by taking finite linear combinations of the vectors in the set. It is easy to see/prove that this is a linear subspace. Knowing which points you can reach also tells you which you can't reach, of course, and whether you can reach every point or not.
Linear algebra is not a theory about vectors, it's a theory about spaces.
In set theory, you can reason about a set $S$ by representing elements of it symbolically, i.e. with variables $x, y, z,$ whathaveyou. If we're reasoning about three elements at a time, we can think of this as probing $S$ with a function from a three-element set $\{ x,y,z \}$ to $S$ (i.e., an arrow $\{ x, y, z \} \rightarrow S$).
In linear algebra, analogously, you use the free vector space $F(\{ x,y,z \})$ over $\{ x,y,z \}$, which is like the standard 3D space over the field of scalars, to probe a vector space V, by way of a linear map $F(\{ x,y,z \}) \rightarrow V$. Instead of getting a subset of atmost three elements of $S$, you get a subspace of atmost dimension 3 of V. This is the image of the linear map, and is the same as the span of the values of $x, y,$ and $z$ under the map.
The "dimension at most 3" part is relevant for linear maps in graphics. If you want to make sure you project the outline of a cube into 2D so that you can see every face, what you're saying is you want no two edges drawn to overlap in a line segment. So, for every point of the cube, you want it so that if you take that point as your origin for a 2D vector space, every two points connected to it by an edge span the plane. Embedding the 2D space into 3D as a plane offset from the origin, you can use affine span instead of linear span and a reference to each origin: Try taking the affine span of (1,0) and (0,1) in 2D, and then its convex hull. All three of these spans are closure operators, and they are generally helpful for solving and problems to do with arranging things a certain way.
But something I've just had to draw is this 3D solid which has a special point at the center and spokes coming out of it, and where the points at the end of the spokes are all distributed around the unit sphere around the special point. Then, since you can see all the points from the center, you only need to check that if you take the center to be the origin, you can distinguish all the points as you see them on the sphere from the origin. Hence, to have a 3D projection like this that keeps all the points and edges separate, it suffices for the linear span of every two spoke terminals to be 2D and not 1D. Why say it that way? Because you have to sometimes look at the shape before you draw it, and if you can't tell from the drawing whether the points are the same, you need a way to test for that. So for this problem, the linear span is a tool for designing a projection, and describing a constraint on the program in a way that the same libraries you're probably writing the project code in can deal with.