Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'The Angle between complex vectors' topicStudent Support Forum > General > "The Angle between complex vectors"

Next Comment >Help | Reply To Topic
Author Comment/Response
Eric Burling
08/20/04 11:22am

I want to find the cosine of the angle A between 2 complex vectors, u = {c1,c2} and v = {c3,c4} using the formula :- cosA = <u|v> /||u||*||v||
I created 3 functions to insert into the above as follows :-
i) innerP[c1_,c2_,c3_,c4_]:=ComplexExpand[{Conjugate[c1],Conjugate[c2]}.{c3,c4}]
to calculate <u|v>

ii) normU[c1_,c2_]:=(ComplexExpand[{Conjugate[c1],Conjugate[c2]}.{c1,c2}])^1/2


iii) normV[c3_,c4_]:=(ComplexExpand[{Conjugate[c3],Conjugate[c4]}.{c3,c4}])^1/2
to calculate the norms ||u|| and||v||

Using the values c1=I; c2=1; c3=1/2-1/2*I; c4=1/2+1/2*I and the formula :-


I obtained non-real results which I could not interpret. Is this because the formula does'nt work with complex vectors or is my syntax flawed somewhere? Any help would be greatly appreciated.

URL: ,

Subject (listing for 'The Angle between complex vectors')
Author Date Posted
The Angle between complex vectors Eric Burling 08/20/04 11:22am
Re: The Angle between complex vectors Henry Lamb 08/23/04 04:18am
Next Comment >Help | Reply To Topic