I can only guess what you are asking. I, therefore, explain the whole thing in 2 steps.
I. Find the co-ordinates of the centroid, P(x, y) for ⊿ABC where $A= (x_1, y_1), B= (x_2, y_2)$ and $C=(x_3, y_3)$.
1.1 Let $D(p,q)$ be the midpoint of BC. Then, by mid-pt formula, $p = \frac {x_2 + x_3}{ 2}$, (similar result for q).
1.2 From geometrical knowledge, P(x, y) must lie on the median AD and, AP : PD = 2 : 1.
1.3 Apply the section formula to get $x = \frac {x_1 + x_2 + x_3} {3}$, (similar result for y).
II. Find $x_3$ if $x_1, x_2$ and $x$ are known.
2.1 Just plug in the given data at the right places in the developed formula, $x_3$ can then be found.
(I assume that you meant "the orthocenter of the triangle is the origin.")
Let $A$ be $(5,-1)$, $B$ be $(-2,3)$, $O$ be the origin, and your desired third vertex be $C$.
Find the line through $O$ perpendicular to $\overline {AB}$: this will be the altitude of the triangle through $C$. (I get $-7x+4y=0$.) Then find the line through $A$ perpendicular to $\overline {BO}$: this will define the side of the triangle opposite to $B$, so this line also goes through $C$. (I get $-2x+3y=13$.)
The intersection of those two lines is $C$, your third vertex of the triangle. (I find the point to be $(-4,-7)$.)
You can check your answer by seeing that the line through $A$ and $O$ is perpendicular to the line through $B$ and $C$.
I'm sure you know the easy way to find perpendicular lines and to check that two lines are perpendicular.
Best Answer
Suppose we have centroid $M = (x_0,\ y_0)$ and vertex $A=(x_1,\ y_1)$.
First let us center the triangle at the origin with shifted vertex $$A' = (x_1',\ y_1') = (x_1 - x_0,\ y_1 - y_0)$$ The other vertices will be reached from this one by a rotation about the origin $120^\circ$ clockwise and counter-clockwise. The counter-clockwise rotation matrix is $$R_{120^\circ} = \begin{pmatrix}\cos120^\circ & -\sin120^\circ \\ \sin120^\circ & \cos120^\circ\end{pmatrix} = \begin{pmatrix}-\frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & -\frac{1}{2}\end{pmatrix}$$ with the clockwise rotation matrix as $$R_{-120^\circ} = \begin{pmatrix}\cos120^\circ & \sin120^\circ \\ -\sin120^\circ & \cos120^\circ\end{pmatrix} = \begin{pmatrix}-\frac{1}{2} & \frac{\sqrt{3}}{2} \\ -\frac{\sqrt{3}}{2} & -\frac{1}{2}\end{pmatrix}$$ Your vertices are then $$B' = \begin{pmatrix}-\frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & -\frac{1}{2}\end{pmatrix}\begin{pmatrix}x_1' \\ y_1'\end{pmatrix}=\begin{pmatrix}-\frac{1}{2}x_1' - \frac{\sqrt{3}}{2}y_1' \\ \frac{\sqrt{3}}{2}x_1' - \frac{1}{2}y_1'\end{pmatrix}$$
$$C' = \begin{pmatrix}-\frac{1}{2} & \frac{\sqrt{3}}{2} \\ -\frac{\sqrt{3}}{2} & -\frac{1}{2}\end{pmatrix}\begin{pmatrix}x_1' \\ y_1'\end{pmatrix}=\begin{pmatrix}-\frac{1}{2}x_1' + \frac{\sqrt{3}}{2}y_1' \\ -\frac{\sqrt{3}}{2}x_1' - \frac{1}{2}y_1'\end{pmatrix}$$ Adding $M$ to each coordinate shifts back the triangle to the original spot.