I don't know what you have done yet (your post is a bit chaotic put simply), I'll just say that you basically need the equation of two of the lines that cleanly cut one point of the triangle and make a right angle with the opposite side of the triangle. Once you get both equations of lines, solve the linear system to get the point of intersection of the two lines : that is the orthocenter of the triangle.