Cartesian Line to Projective Coordinates

449 Views Asked by At

I have an equation of a line written in slope intercept form $y = mx + b$ How would I translate it from the 2d space into the projective space?

I have been reading Wikipedia and I believe this is the Homogeneous coordinates and the equation that I come up with $ax + by + cy = 0$

Any examples would be preferred!

1

There are 1 best solutions below

0
On BEST ANSWER

Your case is the simple one

  1. You can choose $$L=\begin{pmatrix} -m \\ 1 \\ -b \end{pmatrix}$$ $$(-m) x+(1) y+(-b)=0$$
  2. For a line through $(x_c,y_c)$ with angle $\varphi$ from the horizontal then $$ L =\begin{pmatrix} -\sin\varphi \\ \cos\varphi \\ x_c \sin\varphi - y_c \cos\varphi \end{pmatrix}$$ $$ (-\sin\varphi) x + (\cos\varphi ) y + (x_c \sin\varphi - y_c \cos\varphi) = 0$$ $$ -(x-x_c) \sin\varphi + (y-y_c) \cos\varphi = 0 $$
  3. For a line through two points $(x_1,y_1)$ and $(x_2,y_2)$ $$L=\begin{pmatrix} -(y_2-x_1) \\ (x_2-x_1) \\ y_2 x_1 - x_2 y_1 \end{pmatrix} $$ $$ (y_1-y_2) x + (x_2-x_1) y + (x_1 y_2 - x_2 y_1) = 0 $$

NOTE:The line through two points in homogeneous coordinates is defined as $$L = \begin{pmatrix} x_1 \\ y_1 \\ w_1 \end{pmatrix} \times \begin{pmatrix} x_2 \\ y_2 \\ w_2 \end{pmatrix} = \begin{pmatrix} w_2 y_1 - w_1 y_2 \\ w_1 x_2 - w_2 x_1 \\ y_2 x_1 - x_2 y_1 \end{pmatrix} $$ where $\times$ is the vector cross product.

Conversely the point intersected by two lines in homogeneous coordinates is defined as $$P=\begin{pmatrix} a_1 \\ b_1 \\ c_1 \end{pmatrix} \times \begin{pmatrix} a_2 \\ b_2 \\ c_2 \end{pmatrix} = \begin{pmatrix} c_2 b_1 - c_1 b_2 \\ c_1 a_2 - c_2 a_1 \\ b_2 a_1 - a_2 b_1 \end{pmatrix} $$