Here's the idea: Centroid is the meeting point of the medians and orthocenter is the meeting point of the altitudes..

Take it as an exercise to show that: if are the vertices of a triangle, then the centroid is .

As for the orthocenter. Find the equation of the line BC and then find the equation of the line that has a slope of (where is the slope of BC) and passes through A.

Do the same thing for another vertex and get the equation of another altitude. Now get the meeting point of the intersection which is the required orthocenter...