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)