# Orthocentre of a triangle

How do we determine the orthocentre of a triangle when the vertices are given as $(0,0),(x_1,y_1),(x_2,y_2)$?

In a normal case i would take out the equation of any two perpendicular bisectors, get the intersection and then find centroid using formula and then use the OGC rule.......

The answer given in my book is-

$$\left(\frac{(y_1-y_2)(x_1x_2+y_1y_2)}{x_2y_1-x_1y_2},\frac{(x_1-x_2)(x_1x_2+y_1y_2)}{x_1y_2-x_2y_1}\right)$$

But what about a general case? I am not able to derive it..... Pls help......

Let $O(0,0),A(x_1,y_1),B(x_2,y_2)$.
A line perpendicular to $AO$ that passes through $B$ is $$(x_1-0)(x-x_2)+(y_1-0)(y-y_2)=0.$$
A line perpendicular to $BO$ that passes through $A$ is $$(x_2-0)(x-x_1)+(y_2-0)(y-y_1)=0.$$
Now solve these for $x,y$.