# Some point in a line $Ax+By+C=0$

Given a line in a 2D space, defined by equation $Ax+By+C=0$, is it possible to find a point of it without assume that A or B are different of 0 ?

That is, usually the method to find some point is "assume $A \ne 0$, if we fix $y=0$ the solution of the equation gives that point $(-C/A,0)$ is a point of the line, otherwise $B \ne 0$ and ...·

But it is possible any other method without split the problem in two ?

In other words, is it possible to find an expression for some point (any one) of the line that doesn't contains a division by A, B or C or by any other term that can be zero in some cases ?

The question could be expressed in another way: given a line $Ax+By+C=0$, give an expression of the same line in vector/parametric form that is valid for any value of A, B, C.

The direction vector is easy to find, (-B,A), the remainder target is to find the expression of some point.

• Sorry I didn't understand precisely your point, could you better explain please? – gimusi Mar 22 '18 at 17:22
• @gimusi: clarified in the question (and thanks for asking instead of close vote) – pasaba por aqui Mar 22 '18 at 17:25
• you are welcome, the implicit cartesian form is the more general to define line equation (the explicit doesn't work for vertical line), as an alternative you can use parametric equation. – gimusi Mar 22 '18 at 17:29
• thus the problem is: I have Ax+By+C=0 and you want to find a point? – gimusi Mar 22 '18 at 17:33
• @gimusi: yes, the expression of a point, any one. But an expression that doesn' t assume nothing about A,B,C values (except that A and B can not be 0 at same time). – pasaba por aqui Mar 22 '18 at 17:37

Consider the additional line $Bx-Ay=0$. The linear system \begin{cases} Ax+By=-C\\[4px] Bx-Ay=0 \end{cases} has solution $$x=-\frac{AC}{A^2+B^2} \qquad y=-\frac{BC}{A^2+B^2}$$

The additional line is the perpendicular passing through the origin and we found the intersection of the two lines. If $C=0$, we of course get $(0,0)$, but no assumption on $C$ is actually necessary.

Since either $A$ or $B$ is nonzero, we have $A^2+B^2\ne0$, so the division doesn't pose problems.

A graphic example with $A=3$, $B=2$, $C=5$ that shows we're essentially finding the point having minimal distance from the origin.

If instead you consider as additional line $Bx-Ay=t$, for a variable $t$, the solution is $$x=-\frac{AC-Bt}{A^2+B^2} \qquad y=-\frac{BC+At}{A^2+B^2}$$ and, as $t$ varies, you get all points on the given line.

• You are assuming C=0, this is not a general expression of a point for any line defined as Ax+By+C=0. Moreover, see previous Ethan answer. – pasaba por aqui Mar 22 '18 at 17:53
• @pasabaporaqui No, this is correct. If you substitute those values in your equation you do get $Ax + By +C = 0$, for any value of $C$. – Ethan Bolker Mar 22 '18 at 17:55
• @pasabaporaqui: Given that the final solution explicitly contains $C$, it is quite obviously not assumed that $C=0$. Note that the line $Bx-Ay=0$ is a different line (that is perpendicular to the original one). – celtschk Mar 22 '18 at 17:56
• @pasabaporaqui Sorry: had to post the answer before the battery of the tablet died. I added a few comments now. Please, remove the comment to the accepted answer about being the first: it wasn't. I'm not begging for the check mark, I'm more satisfied to have written something that teaches how to get the solution. – egreg Mar 22 '18 at 18:05
• :-) battery always dies in worst moments, they have a sensor. If I understand, this point is at the cross of the line with a perpendicular that pass by (0,0), and its modulus is the distance minimal from line to (0,0) – pasaba por aqui Mar 22 '18 at 18:12

How about $$( -\frac{AC}{A^2 + B^2}, - \frac{BC}{A^2 + B^2})$$

• The particular case $C=-1$ is useful – Orest Bucicovschi Mar 22 '18 at 17:55

This is an interesting question. I think the answer is "no".

If $C = 0$ then the point $$\left( \frac{AB^2}{A^2+B^2}, \frac{-A^2 B}{A^2+B^2} \right)$$ will do, but if $A=0$ and $C \ne 0$ then $y$ must be $-C/B$. You have to divide by $B$. Any general formula you propose to deal with the general problem will have a $B$ in the denominator.

Edit. As @gimusi points out, $(B, -A)$ works when $C=0$. My solution was clumsy.

Edit. My "think so" is wrong. Other answers are better. At least my use of $A^2 + B^2$ was on the right track. It's the determinant of the matrix in @egreg 's solution.

For $C=0$, we can choose

• $x=-B$
• $y=A$

For $C\neq0$ and $A=1$, we can choose

• $x=-C-By$

For $C\neq0$ and $B=1$, we can choose

• $y=-C-Ax$

For $C\neq0$ and $C=kA$, we can choose

• $x=-B-k$
• $y=A$

For $C\neq0$ and $C=kB$, we can choose

• $x=-B$
• $y=A-k$

otherwise we need always division.

• But what two points will you use? Can you describe them in terms of $A$ and $B$ without division by either? – Ethan Bolker Mar 22 '18 at 17:29
• @pasabaporaqui maybe I didn't cacth the motivation of the OP :) The other alternative is the explicit form $y=mx+n$, what about it? – gimusi Mar 22 '18 at 17:32
• Thanks for your answer, the interesting open point is proof the statement "otherwise you need always division". – pasaba por aqui Mar 22 '18 at 17:39
• @pasabaporaqui ah ok, now is clear to me! – gimusi Mar 22 '18 at 17:41
• Probably I should clarify before that division by a term that can not be 0 in any case is valid – pasaba por aqui Mar 22 '18 at 18:04