For the circumcenter:

Let be the circumcenter. Then which is equivalent to .

and you have to solve the system.

For the ortocenter you have to find the equations of two heights of the triangle and then to solve the system of two equation.

The equation for the height passing through X:

Find the slope of the line YZ: . Then the slope of the height is .

The equation of the height is

In the same way find the equation of the height pasiing through Y, then solve the system.