Thanks for the answers.
Unfortunately, I already know all that. I also get the centroids with nettopology. I'm looking for the center of mass. But in my opinion, both polygons are convex. Therefore, I don't understand why one is inside and the other outside...