# Derivation of equation of the straight line through two points $x_1$ and $x_2$ in $\mathbb{R}^N$ (in convex function definition).

I am getting started on reading convex optimization. One equation that is being used to represent traveling from one point to another in a straight line in a convex set is:

$$y = (1-\theta) x_1 + \theta x_2$$ for two points $$x_1 \neq x_2$$ where $$x_1, x_2 \in \mathbb{R}^N$$.

I think I have an intuitive understanding of how this is a straight line, but I am trying to derive is from the usual equation of straight line going through two points. $$y = y_1 + m(x-x_1)$$ where $$m = \frac{y_1 - y_2}{x_1-x_2}$$. Could anyone convince me how the first equation was derived and what the parameter $$\theta$$ means or represents?

Thanks a lot.

• $\theta$ is the independent variable in a similar way than $x$ in your second equation Commented Jan 30, 2021 at 18:50
• Is it some sort of parameterization? Would you be able to provide a derivation if possible? Thanks Commented Jan 30, 2021 at 18:55
• You don't want point-slope, although you could do that variable by variable. It's better to know how to parametrize a line in $n$-space using vectors: point and direction vector. Commented Jan 30, 2021 at 19:10
• @TedShifrin Thanks your comment helps a lot! I was looking at it in the wrong framework. I am going through the answer to understand it. Thanks! Commented Jan 30, 2021 at 19:17

If $$x, y\in \mathbb{R}^n$$, then $$L := \{ x + \theta(y-x) \mid \theta \in \mathbb{R} \}$$ represents the line passing through $$x$$ (when $$\theta = 0$$) and $$y$$ (when $$\theta = 1$$) in the direction of the vector $$y-x$$.
Notice that $$x + \theta(y-x) = (1-\theta)x + \theta y$$ and $$L(x,y) := \{ (1-\theta)x + \theta y \mid \theta \in [0,1] \}$$ is the line-segment containing $$x$$ and $$y$$.
This can be visualized in $$\mathbb{R}^2$$ using the parallelogram law: