2 points in n-dimensional space

795 Views Asked by At

Given 2 points $p_1=(x_1^1, x_2^1, ..., x_n^1)$ and $p_2=(x_1^2, x_2^2, ..., x_n^2)$ in $n$-dimensional Euclidean space, how would you define the straight-line from $p_1$ to $p_2$ with these 2 points being the endpoints of the line.

There are a few of things I've been completely unable to figure out. One is the slope of the line, and the other is how to define the line such that it has endpoints.

For now, I've only attempted to do this as a Cartesian equation with a number of inequality conditions which I feel could be more complex than necessary. If there are alternative methods of defining a line I will be happy to see that.

2

There are 2 best solutions below

2
On BEST ANSWER

You can use a parametric representation: $p_1+(p_2-p_1)t$, $t\in[0,1]$. Slope doesn't make sense in more than 2 dimensions, instead one may consider the direction cosines.

3
On

From wiki:

In more general Euclidean space, Rn (and analogously in every other affine space), the line L passing through two different points a and b (considered as vectors) is the subset

$$L = \{(1-t)\,a+t\,b\mid t\in\mathbb{R}\} $$