I have had two courses of linear algebra and was always aware that affine spaces were a thing. What I know about affine spaces are that they are similar to vector spaces but do not necessarily have to go through the euclidean origin. Aside from this I only know the the difference of two vectors (displacement vector) in the affine space will be a point / position vector on the associated linear space that goes through the origin. Thats where my knowledge ends.
I was playing around today with the affine line
$$\vec{r}(t) = \begin{pmatrix}1\\-3\\4 \end{pmatrix} + t \, \begin{pmatrix}1\\2\\1 \end{pmatrix},$$
and its associated linear line
$$\vec{r_{1}}(t) = t \, \begin{pmatrix}1\\2\\1 \end{pmatrix}.$$
I wanted to
find the closest point on the affine line $\vec{r}(t)$ to the actual orgin in $\mathbb{R}^{3}$
because it didn't seem like it should be too hard, but I am failing. Any advice?
For visualization I was plotting these objects and verifying the difference of vectors / parallelogram rule.
Its probably pretty unclear whats going on in this photo, I should have labeled things. I'll work on adding some labels right now.
Also this problem can probably be solved without the notions of affine spaces but I guess I was trying to do this task as a way to slowly learn / get oriented with affine spaces.. so I will gladly accept answers and comments with or without talk of affine spaces.

The closest point on the affine line to the origin will be one which has the smallest norm (this is just a rewording). First, we will calculate the point, and then show that it is the desired point.
To find the point, we are going to subtract off the part of $p=[1,-3,4]^t$ that is parallel to the affine line. The resulting vector will point straight from the origin to the affine line at a right angle to the line.
The affine line is parallel to $v=[1,2,1]^t$, so we normalize this to a unit vector $u=\frac{1}{\sqrt{6}}[1,2,1]^t$. If we take the dot product of this unit vector with $p$, then we will get magnitude of the component of $p$ parallel to the affine line. The dot product is $p\cdot u = \frac{1}{\sqrt{6}}(1-6+4)=\frac{-1}{\sqrt{6}}$. Thus the component of $p$ in the $v$-direction is $(p\cdot u)u=\frac{-1}{6}[1,2,1]^t$. Subtracting this off from $p$ yields $$p- (p\cdot u)u=[1,-3,4]^t-\frac{-1}{6}[1,2,1]^t=\frac{1}{6}[7,-16,25]^t.$$ Call this point $q$, and note that it has length $\frac{\sqrt{930}}{6}\approx5.08$.
Now we must show that any other point on the line is at least that far away from the origin. $$\lVert[t+1,2t-3,t+4]^t\rVert^2 =(t+1)^2+(2t-3)^2+(t+4)^2\\ = t^2+2t+1+4t^2-12t+9+t^2+8t+16\\ =6t^2-2t+26$$ has vertex at $t=\frac{1}{6}$ with value $\frac{155}{6}=\left(\frac{\sqrt{930}}{6}\right)^2$. So $\frac{\sqrt{930}}{6}$ is the smallest distance from a point on the affine line to the origin, and we have a point on the affine line that is precisely that distance.
The generalization of all the above is is called the Gram-Schmidt process. You can read more about it here: https://en.wikipedia.org/wiki/Gram–Schmidt_process