Projectile velocity and direction from mouse movement?

I want to shoot a projectile (first person game), but in a way that its velocity (and maybe its direction) comes from the cursor’s movement. When holding down the mouse button, the faster i “swipe” and/or the longer the swipe’s distance is on the screen, the faster it shoots out.
Maybe even using the position of the release for aiming.

So for example i press down the LMB, swipe in a straight line from the corner of the screen to the middle, or drawing a circle so the projectile can gain “momentum”, then release the LMB so it can shoot out. If the end of the swipe is fast, it shoots faster.
And not sure if it’s a great idea in terms of gameplay, but the position where i release the LMB could indicate the direction of the projectile, making shooting and aiming a quite manual thing.

So, how could i get the distance my cursor has traveled, and the speed right when releasing the button?
Maybe aiming could be solved by projecting a trace line through the position of the cursor?
Obviously i don’t want anyone to design it for me, but if i could get some general direction or tips on where to start, what to look for, i would be really grateful. Google hasn’t helped much.

Thank you very much!