11

I found the following sentence.

To find the angle you use the arctangent function like this, angle $=\tan^{-1}\left(\frac{y}{x}\right)$.

But I am curious, is this the only way to know the angle? In other words, is it possible to find the angle with $\sin\left(\frac{y}{x}\right)$, $\cos\left(\frac{y}{x}\right)$ or $\tan$.. etc?

gmotree
  • 229

5 Answers5

8

For any given point $(x, y)$, the angle say $\theta$ of the line, passing through this point & the origin, with the positive x-direction is given as $$\color{blue}{\tan\theta=\frac{y}{x}}$$ While other values are given as
$$\color{blue}{\sin\theta=\frac{y}{\sqrt{x^2+y^2}}}$$ $$\color{blue}{\cos\theta=\frac{x}{\sqrt{x^2+y^2}}}$$

6

Does the picture below help you visualise this? By 'angle' we mean $\theta$ below in plane polar coordinates. For some point $(x_0,y_0)$ on the plane, we can solve for $\theta$ using trigonometry.

Diagram

  • Thanks art pictures. Yes so I asking about can we know the angle from any other tri- functions. – gmotree Jun 16 '15 at 09:09
  • 6
    This answer would be improved my including the actual trig to get theta from x0 and y0 here. – lindes Jun 01 '18 at 04:41
5

In this recent answer, it is shown that $$ \theta=2\arctan\left(\vcenter{\frac y{x+\sqrt{x^2+y^2}}}\right) $$ This formula works for all $x,y$ except on the negative real axis, where $\theta$ goes from just under $\pi$ on top to just above $-\pi$ underneath.

robjohn
  • 345,667
2

You can use one of the following three formulas to find an angle.

1)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}\left(2+\mbox{sgn}(x)\right)\mbox{sgn}(y)$$

$$-\mbox{sgn}(xy)*\mbox{atan}\left(\frac{|x|-|y|}{|x|+|y|}\right)$$

2)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}(2+\mbox{sgn}(x))\mbox{sgn}(y)$$

$$-\mbox{sgn}(xy)\mbox{asin}\left(\frac{\left|x\right|-\left|y\right|}{\sqrt{2*x^2+2*y^2}}\right)$$

3)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}(2+\mbox{sgn}(x))\mbox{sgn}(y)$$

$$-\mbox{sgn}(\left|x\right|-\left|y\right|)\mbox{sgn}(xy)\mbox{acos}\left(\frac{\left|x\right|+\left|y\right|}{\sqrt{2*x^2+2*y^2}}\right)$$

Each of the formulas give the angle from $0$ to $2\pi$ for any value of $x$ and $y$.

For $x=y=0$, the result is undefined.

  • Could you try to use MathJax to format the formula; as is this is hard to read. https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – quid Nov 17 '18 at 17:51
  • The second term of the first formula must be corrected to be the same – theodore panagos Dec 27 '18 at 15:51
  • You can [edit] your post. I'm not quite sure what you want to change. – quid Dec 27 '18 at 15:53
  • The second term of the first formula must be corrected to be the same to the second term of the second and third formula. – theodore panagos Dec 27 '18 at 15:56
  • 1
    Then please do that. – quid Dec 27 '18 at 15:58
  • What means sgn() and how can it be expressed in C? I guess it's close to: double xSign = x >= 0 ? 1.0 : -1.0; but, if so, then what is the point of (sgn(y²)) (because is always positive)? Can we say (sgn(y²)) will always be equals to 1 (if y != 0)? – Olivier Pons Mar 20 '22 at 22:16
0

All of these answers seem academic in nature, which I understand might be the way things are around here. You'll have to excuse me because I am new here.

In an Engineering drawing, measurements are generally relative to something. In my case, I wanted an answer relative to the $Y$ axis. The answers here all seem to assume relative to the $X$ axis.

This formula gives me angle relative to the $Y$ axis where if $Y$ is positive then the angle positive is clockwise and negative is counter clockwise.

If $Y$ is negative then it's relative to the negative $Y$ axis and the rotation is reversed.

$$ {\theta=\arctan\left(\vcenter{\frac x{y}}\right)} $$

This answer is much more simple and it gives the answer I need so I thought I would point that out for anyone trying to apply these answers to real world problems.

HackSlash
  • 101