Relative player velocity?

How do I make something return the players velocity relative to them instead of the world?

[lua]pl:WorldToLocal(pl:GetVelocity())[/lua]

dotproduct was actually what i was looking for, thanks though