How to set HingeJoint anchor?

in my game i have a rod and a sphere. when the rod touch the sphere, it form a HingeJoint at the end of the rod with the sphere.

The problem I am having is the anchor point of the HingeJoint. It is always 0.5 or -0.5. I am not sure how to decide the sign.

I know the sphere position vector and the rod position vector. Can I decide the sign based on that?

Set the location of the objects to 0, 0, 0. The direction of the red, blue, and green arrows correspond to + or - directions. Put the Hinge joint at the location where it belongs on the appropriate side of the object which is determined by the arrows. If you add a force to it you can test to see if it is working.

Add an Empty GameObject at the tip of the rod named “Rod Tip”. Attach a rigidbody and a hingeJoint to the Rod Tip.
EDIT: Make rigidbody Kinematic!
On touch assign the Rod Tip.hingeJoint.connectedBody (something like this, look it up) to the sphere. And walla, you dont need to worry about anchoring, because 0,0,0 will always be correct.