You can find the centroid of any polygon by averaging all of its vertices. If, for example, you know the exact x,y coordinates of the points of your triangle, then add up all the x values and divide by three, then add up all the y values and divide by three. That's your center.
Then, of course, you could
ctx.translate(centroidX, centroidY) to that point and
ctx.rotate("90deg") before drawing your triangle.