Lets define few vectors; S = Ship velocity, W = Weapon force to cursor direction, P = Projectile end velocity. 3D vector has 3 components, X, Y, Z. So there exists S.x, S.y, S.z.
If i say A = B + C, in computer terms it means adding each component:
A.x = B.x + C.x
A.y = B.y + C.y
A.z = B.z + C.z...