The points are $(0,0), (0,3), (3,3)$.
I know that square of distances are: $$x^2+y^2\ \text{for} \ (0,0)$$ $$x^2+(y-3)^2\ \text{for}\ (0,3)$$ $$(x-3)^2+(y-3)^2\ \text{for}\ (3,3)$$ And if i sum all of them i have $f(x,y)=3x^2+3y^2-12y-6x+27$
whose partials derivatives are $f_x=6x-6$ and $f_y=6y-12$
finally, if a solve them i end with a single critical point: $(1,2)$
The problem is that with the second derivative test i do not have information about whether it is a maximum or minimum point. I also believe that there must be other points, maybe i could find them with Lagrange multipliers considering that they should be inside the triangle? Or would this end here?
In fact, you can use a second-derivative test to classify the critical point. You just have to use the right one. For a multivariable function, you must examine the Hessian matrix, which is the matrix of all of the second-order partial derivatives. For this function, this is $$H = \begin{bmatrix}f_{xx}&f_{xy}\\f_{yx}&f_{yy}\end{bmatrix} = \begin{bmatrix}6&0\\0&6\end{bmatrix}.$$ This is obviously positive-definite, so the critical point is a minimum.