A and B are two vectors and theta is the angle between them