Finding angles between a linear function and the y-;x-axis and their respective consines

I've run into a problem while finding a directional derivative of a function. The function is as follows:

\begin{align} z &= \frac{x}{y} \\\\ \end{align} The task is to find its directional derivative at a point M whose coordinates are x=1, y=1 in the direction of a vector defined by f(x) that is perpendicular to the graph of f(x)=2x-1 at the point M. I found that the perpendicular in question is as follows: \begin{align} f(x) &= \frac{-x+3}{2} \\\\ \end{align}

Next, my job is to find cos(x) and cos(y) to plug into the formula:

\begin{align} z'_{l}=f'_{x}cos(x)+f'_{y}cos(y) \end{align}

The problem here is that my teacher and I have considered two different angles and, despite getting the same end results, do not agree about the intermediate steps. My cosines are the following: \begin{align} cos(x) &= -\frac{2}{\sqrt5} \\\\ cos(y) &= \frac{1}{\sqrt5} \end{align} I got cos(y) by considering that a vector defined by \begin{align} f(x) &= \frac{-x+3}{2} \\\\ \end{align} points from origin to the second quadrant, where angle x, the angle with the x-axis, is one that is greater than 90°, and angle y, the angle with the y-axis, is one that is less than 90°, it is adjacent to the y-axis as seen from the second quadrant. My teacher has instead considered both angles to belong to the first quadrant (they haven't considered the vector coming from the origin in the same way I have), which means both angles amount to over 90°. Their angle y is one that is adjacent to the y-axis as seen from the first quadrant. I was pretty sure my logic was very flawed while performing the computation, but I'd like to know what the truth here is for certain. The question is, which is the angle with the y-axis that is given by the function described above?

Thank you.

I would most often think of a 2D direction vector as $$\mathbf{v}=\left\langle \cos\theta,\sin\theta\right\rangle$$ for an appropriate angle $$\theta\in[0,360^{\circ})$$ measured counterclockwise from the positive $$x$$-axis. However, we can also write $$\mathbf{v}=\left\langle \cos\theta_{x},\cos\theta_{y}\right\rangle$$ for an appropriate pair of angles $$\theta_{x}$$ and $$\theta_{y}$$ (I would not recommend using $$x$$ and $$y$$ for angles as one could get confused).
No matter which quadrant $$\mathbf{v}$$ lies in, we can take $$\theta_{x}=\theta$$ (measured counterclockwise from the positive $$x$$-axis), and $$\theta_{y}$$ to be either the clockwise angle from the positive $$y$$-axis: $$90^{\circ}-\theta_{x}$$ or the counterclockwise angle from the positive $$y$$-axis $$\theta_{x}-90^{\circ}$$, since $$\cos\left(\theta_{x}-90^{\circ}\right)=\cos\left(90^{\circ}-\theta_{x}\right)=\sin\theta_{x}=\sin\theta$$.
In your specific example, there are two directions perpendicular to the graph of $$f(x)=2x-1$$: an approximately "east southeast" direction $$\left\langle \dfrac{2}{\sqrt{5}},-\dfrac{1}{\sqrt{5}}\right\rangle$$ and an approximately "west northwest" direction $$\left\langle -\dfrac{2}{\sqrt{5}},\dfrac{1}{\sqrt{5}}\right\rangle$$ . Suppose $$\theta\approx153^{\circ}$$ so that $$\left\langle -\dfrac{2}{\sqrt{5}},\dfrac{1}{\sqrt{5}}\right\rangle =\left\langle \cos\theta,\sin\theta\right\rangle$$ . Then if we define $$\theta_{x}=\theta$$ and $$\theta_{y}=\theta-90^{\circ}\approx63^{\circ}$$ (the counterclockwise angle from the positive $$y$$-axis to the vector), we indeed have $$\left\langle -\dfrac{2}{\sqrt{5}},\dfrac{1}{\sqrt{5}}\right\rangle =\left\langle \cos\theta_{x},\cos\theta_{y}\right\rangle$$ , so that your calculation works fine.
I don't quite understand from your description which $$y$$-angle your teacher has calculated, but values of $$\theta_{y}$$ approximately equal to $$-63^{\circ}$$ or $$297^{\circ}$$ would also work for the $$y$$-coordinate if they were using the $$\left\langle \cos\theta_{x},\cos\theta_{y}\right\rangle$$ setup you were. And values approximately equal to $$153^{\circ}$$ or $$27^{\circ}$$ or $$-207^{\circ}$$ would work if they were using a $$\left\langle \cos\theta_{x},\sin\theta_{y}\right\rangle$$ setup like I am more used to. Note that the angles which work would also all change if your teacher were using $$\left\langle \dfrac{2}{\sqrt{5}},-\dfrac{1}{\sqrt{5}}\right\rangle$$ instead of $$\left\langle -\dfrac{2}{\sqrt{5}},\dfrac{1}{\sqrt{5}}\right\rangle$$ .