# Measurement of angle of vectors gives strange result…

I found something that I don't know how to approach. I have been studying vectors and I thought that I understood it ok, but this confuses me... (but it seems very simple!).

I have two direction vectors:

$$(300,\quad 300)\\ (0,\quad 200)$$

So I calculated their angle using:

$$cos\theta \quad =\quad \frac { (300*0)+(300*200) }{ \sqrt { { 300 }^{ 2 }+{ 300 }^{ 2 } } *\sqrt { { 0 }^{ 2 }+{ 200 }^{ 2 } } }$$

And I got a reasonable 45 degrees as a result.

The problem came when I found a vector which was perpendicular to the first one. It is:

$$A=(150,50)\\ B=(-35,55)\\ \\ So\quad the\quad director\quad is\\ (-185,5)\\$$

I calculate the angle against the second direction vector of the beginning (0, 200) using the same system as before, and I am getting 90 degrees as result instead of the expected 45. What did I do wrong?

$$cos\theta \quad =\quad \frac { (-185*0)+(5*200) }{ \sqrt { { -185 }^{ 2 }+{ 5 }^{ 2 } } *\sqrt { { 0 }^{ 2 }+{ 200 }^{ 2 } } }$$

Thank you for any comment!

EDIT: I translate (is not in english) and add the statement of what I am trying to solve:

We have two segments. They are located in the plane in the following coordinates:

Segment A:

Beginning: (150,50) Ending: (550,350)

Segment B:

Beginning: (150,50) Ending: (150,250)

It's necessary to find the measure of the angle that the two segments make, and then find out the coordinates of a new segment perpendicular to A, also sharing the beginning with the original A, and measuring only 50 (note: I am drawing this in Adobe Flash. The measurements we use are pixels, and the original segment A measures 500 pixels)

-
Are you claiming that $(-185,5)$ is perpendicular to $(300,300)$? This is not so... – David Mitra Dec 11 '12 at 13:15
edited. Misunderstood. – telex-wap Dec 11 '12 at 13:19
final edit: Yes, I checked again, and a segment where A=(150,50) and B=(550,350), seems perpendicular to another where A=(150,50) and B=(-35,55)... and (-185,5) is the director of this last segmento... whereas (300,300) is the director of the first one. – telex-wap Dec 11 '12 at 13:21
Could you possibly include a statement of the problem you are trying to solve? It's not clear to me what you are trying to do. – David Mitra Dec 11 '12 at 13:46
The direction vector for segment $A$ is $(400,300)$, not $(300,300)$. The new segment should be perpendicular to $A$, so its direction vector can be taken to be $(-300,400)$ (note segment $B$ does not come into play here). – David Mitra Dec 11 '12 at 15:39