Matrix methods for equation of a line

  • Context: Undergrad 
  • Thread starter Thread starter zcd
  • Start date Start date
  • Tags Tags
    Line Matrix
Click For Summary
SUMMARY

The discussion focuses on deriving the constants a, b, and c for the line equation ax + by + c = 0 using matrix methods, given two points in R², denoted as \vec{p}_1=(x_1, y_1) and \vec{p}_2=(x_2, y_2). The solution involves setting up a matrix equation and finding the inverse of the matrix formed by the coordinates of the two points. The final formula for the line is derived as a = (y_1 - y_2) / (x_1 y_2 - x_2 y_1) and b = (x_1 - x_2) / (x_1 y_2 - x_2 y_1). Special consideration is given to the case where the determinant is zero, indicating that the points are collinear and the line passes through the origin.

PREREQUISITES
  • Understanding of linear algebra concepts, specifically matrix operations.
  • Familiarity with the equation of a line in two-dimensional space.
  • Knowledge of determinants and their significance in linear transformations.
  • Basic proficiency in manipulating algebraic expressions and equations.
NEXT STEPS
  • Study matrix inversion techniques and their applications in solving linear equations.
  • Learn about determinants and their role in determining the linear independence of vectors.
  • Explore the geometric interpretation of lines and planes in R² and R³.
  • Investigate other methods for finding line equations, such as using slope-intercept form.
USEFUL FOR

Mathematicians, engineering students, and anyone interested in applying linear algebra to geometric problems, particularly in fields such as computer graphics and robotics.

zcd
Messages
197
Reaction score
0
Given two points on R2 how would one find the constants a,b,c such that
ax+by+c=0 gives the line crossing the two points (with matrix methods)?
 
Physics news on Phys.org
So you're given the points [itex]\vec{p}_1=(x_1, y_1)[/itex] and [itex]\vec{p}_2=(x_2, y_2)[/itex].

A line is given by the equation

[itex] a x + b y <br /> =\begin{pmatrix} a & b \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} <br /> = c[/itex]

Which, assuming [itex]c \neq 0[/itex], can be rescaled to
[itex] \begin{pmatrix} a & b \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} = 1[/itex]
Then the two points must satisfy
[itex]\begin{align}<br /> &\begin{pmatrix} a & b \end{pmatrix}\cdot\begin{pmatrix}x_1&x_2 \\ y_1&y_2\end{pmatrix} = \begin{pmatrix} 1 & 1 \end{pmatrix} \\<br /> \implies<br /> &\begin{pmatrix} a & b \end{pmatrix} = \begin{pmatrix} 1 & 1 \end{pmatrix}<br /> \begin{pmatrix}x_1&x_2 \\ y_1&y_2\end{pmatrix}^{-1}<br /> =\frac{1}{x_1 y_2 - x_2 y_1}\begin{pmatrix} y_1-y_2 & x_1-x_2\end{pmatrix}<br /> \end{align}[/itex]
And so we have the equation for the line. (This is just "[URL rule[/URL])

Note that if [itex]\det(\vec{p}_1, \vec{p}_2) = x_1 y_2 - x_2 y_1 = 0 \,,[/itex] (which happens when [itex]\vec{p}_1\propto\vec{p}_2[/itex])
then the above does not make sense and the line must go through the origin, i.e. [itex]c=0[/itex].
In which case,
[itex]a x = - b y \quad \implies \quad y = -\frac{a}{b}x[/itex]
and we can just use either point to find the single parameter determining the line
[itex]\frac{a}{b} = -\frac{y_1}{x_1} = -\frac{y_2}{x_2} \ .[/itex]
 
Last edited by a moderator:

Similar threads

  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 34 ·
2
Replies
34
Views
3K