# Given the points A(1,2) and B(3,4) calculate the distance from the origin of the axis to the AB line .

*print*Print*list*Cite

First we will determine the equation for the line AB

WE have the points: A(1,2) and B(3,4) pass through the line:

y-y1= m(x-x1) where m is the slope and (x1,y1) is any point passes through the line:

m= (y2-y1)/x2-x1) = 4-2/3-1 = 2/2 = 1

Then y-2 = 1(x-1)

==> y= x+1 is the line's equation

Now we need to calculate the distance between the line and the origin point.

We know that the distance d= c/sqrt(a^2+b^2)

Where ay+bc+d =0 is the standard form of the the line.

The equation we have is y=x+1

Rewrite is standard form:

y-x-1=0

==> d = l -1/ sqrt(1+1)l = 1/sqrt(2)

First of all, you have to find out the equation of the equation of the line AB.

Because we have the coordinates of the points A and B, we'll calculate the equation of the line in this way:

(x - xA)*(yB - yA) = (y - yA)(xB - xA)

(x - 1)(4 - 2) = (y - 2)(3 - 1)

2(x - 1) = 2(y - 2)

We'll reduce with 2:

x - 1 = y - 2

The equation will become:

y - x - 1 = 0

The coordinates of the origin are: O(0,0).

The distance between a point and a line is:

d(O,AB) = mod(-1*0 + 1*0 - 1)/[(-1)^1/2 + (1)^1/2]^1/2

**d(O,AB) = 1/sqrt 2**

The equation of a line passing two given points is this:

(y-y1)/(x-x1)= (y2-y1)/(x2-x1)

So, sub the both A and B coordinates into the equation:

(y-2)/(x-1)= (4-2)/(3-1)

(y-2)/(x-1)=1

y-2=x-1

y-x-3=0

To get distance of point of origin to line:

distance= modulus l -1/sqrt2 l

= 1/sqrt 2

The equation of the line passing through the two points (x1,y1) and (x2,y2) i s given by:

y-y1 = (y2-y1)/(x2-x1) {x-x1}

In this case the equation of the line AB passing through A(1,2) and B(3,4) is :

y-2 = [(4-2)/(3-1)]{x-1}, Or

y-2 = (2/2)(x-1). Or

y-2 = (x-1). Or

x-y-1+2 = 0

Or

x-y+1 = 0 is in the standard form of the equation of a line ax+by+c which has a distance d = | c/sqrt(a^2+b^2)}|.

So the distnce of the origin from the line x-y +1 = 0 is

d = | 1/sqrt(1^1+(-1)^1) | = 1/sqrt2 = (sqrt2)/2