So, the normal vector of a vector A is simply (A)*(1/|A|).here is a simple function for normalizing a vector:Code://Returns a new vector with length 1Vector2f normalize(Vector2f vector){ return (vector*(1.0f/length(vector));}Normalization is often useful when you need to preserve the direction of a vector but not its length.