I am wondering if there exists an invertible linear transformation between a line segment in 3D space and a line segment in 2D space.

Basically, the red line above could be represented by the matrix equation $Ax=b$:
$$A = \begin{pmatrix} 1 & 1 & 1 \\ 0 & 2 & 1 \end{pmatrix}$$ $$b = \begin{pmatrix} 1 \\ 0.5 \end{pmatrix}$$
The blue line above could be represented as $Cx=d$: $$C = \begin{pmatrix} 1 & 1 \end{pmatrix}$$ $$d = \begin{pmatrix} 1 \end{pmatrix}$$
I am also interested if there exists any invertible transformation that may not be linear.
Edit: What if instead of the red line, I have a higher dimensional object (say of dimension $k$), and I want to transform that (invertible) onto the $k$ dimension simplex. Do I have to find the vertices of that object in order to do so? Or would the equations describing it suffice.
All you have to do is map (bijectively) and continuously (if you want) each segment to a segment along the 1-d real line. Hopefully it's clear how to do this, if not then let me know and I'll explain. Then by composing one bijection with the inverse of the other you get your desired map from one segment to another. Furthermore, if you introduce a bijection from the segment in 1-d to itself, which may not be linear, then you can introduce this into your transformation formulas and still get your bijection, and now, not necessarily linear.