Ashok, I assume you are using rectangular coordinates, this is

and

it doesn't really matter that they are complex numbers. Remember dot product

where

is the smallest angle between them, so it is always true that

.

So you can use

. You still need to find the dot product, that is just

and the length of the vectors, that is

so I'm not sure how much memory you are saving with this. And this will give you the smallest angle, that may not be what you need, I don't know.

I advice you look up some math library for c, I'm sure there is an "arg" function implemented that gives you the angles, if you don't want to use that, you can look at the code (if it is accessible) and

get a better idea. I hope that helped, regards

Damián Vallejo.

You can visit my blog if you want, it is

Math 911 I expose some math topics there.