couldn't really think of a title to explain it.

say i have three variables

gravity Y

velocity X

velocity Y

and i wish to make an object jump to a position based on a passed Y velocity value which returns the appropriate X velocity to get to the destination

function getJumpX(px, py, dx, dy, y){

}

var gravity = .5
var vy = -10
var vx = getJump(0, 0, 100, 0, vy)

i honestly have no idea where to start

any ideas?