# What is a normalized Vector?

Can someone explain the following code? I need to learn what each part means so I can turn it into enemy movement in a space shoot-em-up

Vec2d playerPos;
Vec2d direction; // always normalized
float velocity;


I get the above is naming two 2d Vector objects, and creating a variable called velocity. I'm not sure what the normalized comment is about, though.

update()
{
direction = normalize(playerPos - enemyPos);
playerPos = playerPos + direction * velocity;
}

• Have a look at this answer to a previous question. – brice Jun 23 '12 at 21:13