More seriously if you check the reference for the PShape class, you can see all the methods associated to it.
You could use getVertex() to get the position of a vertex in space and if you want the center of the shape, average those locations but the issue is that the PShape stores its transforms in a matrix (PMatrix) and it doesn’t seem you can get the matrix and extract the translation…
An easy solution is to track yourself the location of the shape by applying matrix transformations on an origin point.
I know that you can use a PMatrix object but it’s not very well documented except this Java doc.
You can use it like this:
// Create a new matrix
PMatrix matrix = new PMatrix3D();
// Apply your transformations just like PShape
matrix.translate(200, 0, 0);
matrix.rotateX(HALF_PI);
// Will store the position
PVector position = new PVector();
// Multiply an origin point (if your sphere was at 50, 50, 0)
// and apply the matrix transformations on that point
// store it in the position PVector
matrix.mult(new PVector(50, 50, 0), position);
println(position);
// -> [ 250.0, -2.1855694E-6, 50.0 ]
Maybe there’s a better way to get the PShape location but I think this works