gradient shader between 2 vectors

hi, does anyone know how to make a gradient between 2 vectors in worldspace in shader?
I’m trying to build something like a world point position pass, but I lack the math skillset for it.

I think if I can make one gradient, I could fumble and figure out the rest