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.

  • 2
    $\begingroup$ Sorry I didn't understand precisely your point, could you better explain please? $\endgroup$ – gimusi Mar 22 '18 at 17:22
  • $\begingroup$ @gimusi: clarified in the question (and thanks for asking instead of close vote) $\endgroup$ – pasaba por aqui Mar 22 '18 at 17:25
  • $\begingroup$ 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. $\endgroup$ – gimusi Mar 22 '18 at 17:29
  • 1
    $\begingroup$ thus the problem is: I have Ax+By+C=0 and you want to find a point? $\endgroup$ – gimusi Mar 22 '18 at 17:33
  • $\begingroup$ @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). $\endgroup$ – 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.

enter image description here

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.

  • $\begingroup$ 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. $\endgroup$ – pasaba por aqui Mar 22 '18 at 17:53
  • $\begingroup$ @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$. $\endgroup$ – Ethan Bolker Mar 22 '18 at 17:55
  • 1
    $\begingroup$ @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). $\endgroup$ – celtschk Mar 22 '18 at 17:56
  • 3
    $\begingroup$ @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. $\endgroup$ – egreg Mar 22 '18 at 18:05
  • 1
    $\begingroup$ :-) 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) $\endgroup$ – pasaba por aqui Mar 22 '18 at 18:12

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

  • 1
    $\begingroup$ The particular case $C=-1$ is useful $\endgroup$ – 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.