HingeJoint2d - find connected anchor

I have two object, that can be connected together by HingeJoint2d, I am creating joint by code in c#:

54281-t.jpg

Now when creating joint, I need to specify anchor points, anchor will be always bottom center of the blue object A

However I am unable to calculate connected anchor, my goal is to place connected anchor in exactly the same position as anchor (like on the picture, where red dot it)

Is there possibility to calculate it? Blue box can be connected anywhere (i want to use it as a crane to lift green object)

Thank you.

Yes there is, by transferring the information of position over to the green box:

Vector3 BlueBoxLocalPositionInWorldPosition = bluebox.TransformPoint(Vector3.down * .5f);
Vector3 worldPositionInGreenBoxLocalPosition = greenBox.InverseTransformPoint(worldPositionOfBlueBox);