Easy way to move from A to B on curve? (like throwing a ball from A to B)

Hey all, I’ve been playing around with this scenario and thought I’d ask the group at large for ideas on how to best accomplish this:

I need to move an object, say a ball, from point A to point B, but along an angle.  Think of it as throwing a ball to another person - it has a natural angle about it as it leaves A in an upward motion and then moves toward B and arrives in a downward motion.  

FYI, point B can/will not be the same location, distance, etc. from point A every time, but I’d like the movement to follow some type of curve to point B.  

Is there a preferred way or function that anyone can recommend to make this easy on me?  I’d prefer to start with a transition-based method to avoid any additional physics complexities, but I’m open to transition or physics-based methods - whichever works best.  

Thanks for the help and ideas!

I can do it with 3 functions, but I’m curious if there’s an easier way:

–B is the ball’s destination object

local transtime=1000

local ballrotate=mRand(300,700) --create some rotation to the ball as it is in motion

local trans1 = transition.to(ball, {time = transtime, x = B.x, rotation=-ballrotate})

local trans2 = transition.to(ball, {time = transtime/2, y = ball.y - 150, transition=easing.outQuad})

local trans3 = transition.to(ball, {delay = transtime/2, time = transtime/2, y = B.y, transition=easing.inQuad})

hi, i’d probably use physics but you can also do it on an onFrame event.

from left to right.

local yfactor=-20

object.x=object.x+1 (constant)

object.y=object.y+yfactor

yfactor=yfactor+0.2 (or which ever value fits with how far you want to thro)

off my head

By the sound of it, you want ballistic trajectory.

You can write your own easings, if you want to go through transitions, e.g. see here.

I can do it with 3 functions, but I’m curious if there’s an easier way:

–B is the ball’s destination object

local transtime=1000

local ballrotate=mRand(300,700) --create some rotation to the ball as it is in motion

local trans1 = transition.to(ball, {time = transtime, x = B.x, rotation=-ballrotate})

local trans2 = transition.to(ball, {time = transtime/2, y = ball.y - 150, transition=easing.outQuad})

local trans3 = transition.to(ball, {delay = transtime/2, time = transtime/2, y = B.y, transition=easing.inQuad})

hi, i’d probably use physics but you can also do it on an onFrame event.

from left to right.

local yfactor=-20

object.x=object.x+1 (constant)

object.y=object.y+yfactor

yfactor=yfactor+0.2 (or which ever value fits with how far you want to thro)

off my head

By the sound of it, you want ballistic trajectory.

You can write your own easings, if you want to go through transitions, e.g. see here.