Projectile motion between two positions

Hi All, Please help me to solve projectile motion between two positions?

Um… no? To get a concrete answer, you need to ask a concrete question. What you want to achieve, what you’ve tried and what you have now.

Do you mean having a projectile move between two positions?

Yes. Here what I did so far.

        _position.X = initialPosition.X + initialVelocity.X * time; 
        _position.Y = initialPosition.Y - (initialVelocity.Y * time - 0.5f * gravity.Y * time * time);

I want to complete projectile motion within 1 sec. Here is the initial velocity and target position
Vector2 initialVelocity = new Vector2(30,30);
Vector2 gravity = new Vector2(0,-0.98f);
Vector2 initialPosition = new Vector2(500,775);
Vector2 destination = new Vector2(800, 775);

The issue is movement is not as expected. it moves continuously in y axis.

maybe this will help.

Did you forget to increase the Y velocity afterwards?

initialVelocity += gravity * time;

var curPos = Vector2.Lerp(srcPos, dstPos, elapsedSec);

Actually though heres your error.
_position.Y = initialPosition.Y - (initialVelocity.Y * time - 0.5f * gravity.Y * time * time);
should be
_position.Y = initialPosition.Y + (initialVelocity.Y * time - 0.5f * gravity.Y * time * time);