We have angle=arctan(dy/dx), but what happens when dx=0?
Here is a formula: $text{angle}=arctan(dy/dx)$.
I can find an angle with my calculator for any value except $dx=0$.
My question is: is there no angle or, is there something that says when $dx=0$ the angle is found differently?
trigonometry analytic-geometry angle
add a comment |
Here is a formula: $text{angle}=arctan(dy/dx)$.
I can find an angle with my calculator for any value except $dx=0$.
My question is: is there no angle or, is there something that says when $dx=0$ the angle is found differently?
trigonometry analytic-geometry angle
1
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42
add a comment |
Here is a formula: $text{angle}=arctan(dy/dx)$.
I can find an angle with my calculator for any value except $dx=0$.
My question is: is there no angle or, is there something that says when $dx=0$ the angle is found differently?
trigonometry analytic-geometry angle
Here is a formula: $text{angle}=arctan(dy/dx)$.
I can find an angle with my calculator for any value except $dx=0$.
My question is: is there no angle or, is there something that says when $dx=0$ the angle is found differently?
trigonometry analytic-geometry angle
trigonometry analytic-geometry angle
edited Nov 3 '15 at 22:57
user147263
asked Mar 15 '11 at 16:18
Alpagut
12016
12016
1
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42
add a comment |
1
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42
1
1
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42
add a comment |
5 Answers
5
active
oldest
votes
If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $frac{pi}{2}$ or $frac{3pi}{2}$, depending if $dy > 0$ or $dy < 0$.
add a comment |
Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $arctan(x,y)$ (denoted as atan2()
in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $arctan(x,y)$ gives the same results as $arctanfrac{y}{x}$, adjusted when necessary so that the result is within $(-pi,pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $yneq 0$, $arctan(0,y)=frac{pi}{2}mathrm{sign},y$.
add a comment |
Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)neq (0,0)$ makes with the positive x-axis is defined as the value $theta (x,y)$ such that
$cos theta (x,y) = frac{x}{sqrt{x^2+y^2}}$ and
$sin theta (x,y) = frac{y}{sqrt{x^2+y^2}}$,
with $thetain [0, 2pi)$. Note that, defined in this way, there is a unique $theta$ for each point different from $(0,0)$.
If $x>0$ and $y>0$, these formulas combined give $theta (x,y) = arctan(y/x)$.
If $x=0$ and $y>0$, it follows from the definition that $theta=pi/2$.
You can also consider $theta in[-pi,pi)$, and in this case the formula $theta (x,y) = arctan(y/x)$ is valid for all $y$ provided $x>0$.
add a comment |
You are correct in pointing out that
$$
theta = arctan{frac{y}{x}}
$$
is not such a great formula, since it
will not work when $x = 0$.
In fact, $arctan$ will always return a value in the interval $(-pi/2, pi/2)$, so it will give the wrong answer for the angle when $x < 0$!
(Unless you don't care if the angle is pointing in the opposite direction from the vector.)
What you really want
the unique angle $theta$, say on the interval $[0, 2pi)$, such that
begin{align*}
sin theta = frac{y}{sqrt{x^2 + y^2}} \
cos theta = frac{x}{sqrt{x^2 + y^2}}.
end{align*}
What is the best way to calculate this?
It's maybe not as elegant as you would like, but you can use
$$
theta =
begin{cases}
arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y ge 0 \
2pi - arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y le 0.
end{cases}
$$
add a comment |
A formula of atan that is working when dx or dy=0.
when dx=dy=0 the result is undefined.
Let"s put dx=x and dy=y.
f(x,y)=pi()-pi()/2*(1+sign(x))* (1-sign(y^2))-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
The angle is from 0 to 2pi.
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f27217%2fwe-have-angle-arctandy-dx-but-what-happens-when-dx-0%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $frac{pi}{2}$ or $frac{3pi}{2}$, depending if $dy > 0$ or $dy < 0$.
add a comment |
If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $frac{pi}{2}$ or $frac{3pi}{2}$, depending if $dy > 0$ or $dy < 0$.
add a comment |
If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $frac{pi}{2}$ or $frac{3pi}{2}$, depending if $dy > 0$ or $dy < 0$.
If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $frac{pi}{2}$ or $frac{3pi}{2}$, depending if $dy > 0$ or $dy < 0$.
answered Mar 15 '11 at 16:25
alejopelaez
1,7851325
1,7851325
add a comment |
add a comment |
Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $arctan(x,y)$ (denoted as atan2()
in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $arctan(x,y)$ gives the same results as $arctanfrac{y}{x}$, adjusted when necessary so that the result is within $(-pi,pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $yneq 0$, $arctan(0,y)=frac{pi}{2}mathrm{sign},y$.
add a comment |
Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $arctan(x,y)$ (denoted as atan2()
in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $arctan(x,y)$ gives the same results as $arctanfrac{y}{x}$, adjusted when necessary so that the result is within $(-pi,pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $yneq 0$, $arctan(0,y)=frac{pi}{2}mathrm{sign},y$.
add a comment |
Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $arctan(x,y)$ (denoted as atan2()
in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $arctan(x,y)$ gives the same results as $arctanfrac{y}{x}$, adjusted when necessary so that the result is within $(-pi,pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $yneq 0$, $arctan(0,y)=frac{pi}{2}mathrm{sign},y$.
Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $arctan(x,y)$ (denoted as atan2()
in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $arctan(x,y)$ gives the same results as $arctanfrac{y}{x}$, adjusted when necessary so that the result is within $(-pi,pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $yneq 0$, $arctan(0,y)=frac{pi}{2}mathrm{sign},y$.
answered Aug 22 '11 at 8:25
J. M. is not a mathematician
60.8k5149287
60.8k5149287
add a comment |
add a comment |
Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)neq (0,0)$ makes with the positive x-axis is defined as the value $theta (x,y)$ such that
$cos theta (x,y) = frac{x}{sqrt{x^2+y^2}}$ and
$sin theta (x,y) = frac{y}{sqrt{x^2+y^2}}$,
with $thetain [0, 2pi)$. Note that, defined in this way, there is a unique $theta$ for each point different from $(0,0)$.
If $x>0$ and $y>0$, these formulas combined give $theta (x,y) = arctan(y/x)$.
If $x=0$ and $y>0$, it follows from the definition that $theta=pi/2$.
You can also consider $theta in[-pi,pi)$, and in this case the formula $theta (x,y) = arctan(y/x)$ is valid for all $y$ provided $x>0$.
add a comment |
Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)neq (0,0)$ makes with the positive x-axis is defined as the value $theta (x,y)$ such that
$cos theta (x,y) = frac{x}{sqrt{x^2+y^2}}$ and
$sin theta (x,y) = frac{y}{sqrt{x^2+y^2}}$,
with $thetain [0, 2pi)$. Note that, defined in this way, there is a unique $theta$ for each point different from $(0,0)$.
If $x>0$ and $y>0$, these formulas combined give $theta (x,y) = arctan(y/x)$.
If $x=0$ and $y>0$, it follows from the definition that $theta=pi/2$.
You can also consider $theta in[-pi,pi)$, and in this case the formula $theta (x,y) = arctan(y/x)$ is valid for all $y$ provided $x>0$.
add a comment |
Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)neq (0,0)$ makes with the positive x-axis is defined as the value $theta (x,y)$ such that
$cos theta (x,y) = frac{x}{sqrt{x^2+y^2}}$ and
$sin theta (x,y) = frac{y}{sqrt{x^2+y^2}}$,
with $thetain [0, 2pi)$. Note that, defined in this way, there is a unique $theta$ for each point different from $(0,0)$.
If $x>0$ and $y>0$, these formulas combined give $theta (x,y) = arctan(y/x)$.
If $x=0$ and $y>0$, it follows from the definition that $theta=pi/2$.
You can also consider $theta in[-pi,pi)$, and in this case the formula $theta (x,y) = arctan(y/x)$ is valid for all $y$ provided $x>0$.
Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)neq (0,0)$ makes with the positive x-axis is defined as the value $theta (x,y)$ such that
$cos theta (x,y) = frac{x}{sqrt{x^2+y^2}}$ and
$sin theta (x,y) = frac{y}{sqrt{x^2+y^2}}$,
with $thetain [0, 2pi)$. Note that, defined in this way, there is a unique $theta$ for each point different from $(0,0)$.
If $x>0$ and $y>0$, these formulas combined give $theta (x,y) = arctan(y/x)$.
If $x=0$ and $y>0$, it follows from the definition that $theta=pi/2$.
You can also consider $theta in[-pi,pi)$, and in this case the formula $theta (x,y) = arctan(y/x)$ is valid for all $y$ provided $x>0$.
answered Mar 15 '11 at 16:29
Ronaldo
92367
92367
add a comment |
add a comment |
You are correct in pointing out that
$$
theta = arctan{frac{y}{x}}
$$
is not such a great formula, since it
will not work when $x = 0$.
In fact, $arctan$ will always return a value in the interval $(-pi/2, pi/2)$, so it will give the wrong answer for the angle when $x < 0$!
(Unless you don't care if the angle is pointing in the opposite direction from the vector.)
What you really want
the unique angle $theta$, say on the interval $[0, 2pi)$, such that
begin{align*}
sin theta = frac{y}{sqrt{x^2 + y^2}} \
cos theta = frac{x}{sqrt{x^2 + y^2}}.
end{align*}
What is the best way to calculate this?
It's maybe not as elegant as you would like, but you can use
$$
theta =
begin{cases}
arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y ge 0 \
2pi - arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y le 0.
end{cases}
$$
add a comment |
You are correct in pointing out that
$$
theta = arctan{frac{y}{x}}
$$
is not such a great formula, since it
will not work when $x = 0$.
In fact, $arctan$ will always return a value in the interval $(-pi/2, pi/2)$, so it will give the wrong answer for the angle when $x < 0$!
(Unless you don't care if the angle is pointing in the opposite direction from the vector.)
What you really want
the unique angle $theta$, say on the interval $[0, 2pi)$, such that
begin{align*}
sin theta = frac{y}{sqrt{x^2 + y^2}} \
cos theta = frac{x}{sqrt{x^2 + y^2}}.
end{align*}
What is the best way to calculate this?
It's maybe not as elegant as you would like, but you can use
$$
theta =
begin{cases}
arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y ge 0 \
2pi - arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y le 0.
end{cases}
$$
add a comment |
You are correct in pointing out that
$$
theta = arctan{frac{y}{x}}
$$
is not such a great formula, since it
will not work when $x = 0$.
In fact, $arctan$ will always return a value in the interval $(-pi/2, pi/2)$, so it will give the wrong answer for the angle when $x < 0$!
(Unless you don't care if the angle is pointing in the opposite direction from the vector.)
What you really want
the unique angle $theta$, say on the interval $[0, 2pi)$, such that
begin{align*}
sin theta = frac{y}{sqrt{x^2 + y^2}} \
cos theta = frac{x}{sqrt{x^2 + y^2}}.
end{align*}
What is the best way to calculate this?
It's maybe not as elegant as you would like, but you can use
$$
theta =
begin{cases}
arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y ge 0 \
2pi - arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y le 0.
end{cases}
$$
You are correct in pointing out that
$$
theta = arctan{frac{y}{x}}
$$
is not such a great formula, since it
will not work when $x = 0$.
In fact, $arctan$ will always return a value in the interval $(-pi/2, pi/2)$, so it will give the wrong answer for the angle when $x < 0$!
(Unless you don't care if the angle is pointing in the opposite direction from the vector.)
What you really want
the unique angle $theta$, say on the interval $[0, 2pi)$, such that
begin{align*}
sin theta = frac{y}{sqrt{x^2 + y^2}} \
cos theta = frac{x}{sqrt{x^2 + y^2}}.
end{align*}
What is the best way to calculate this?
It's maybe not as elegant as you would like, but you can use
$$
theta =
begin{cases}
arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y ge 0 \
2pi - arccosleft( frac{x}{sqrt{x^2 + y^2}} right) &text{if } y le 0.
end{cases}
$$
answered Nov 3 '15 at 22:57
6005
35.6k751125
35.6k751125
add a comment |
add a comment |
A formula of atan that is working when dx or dy=0.
when dx=dy=0 the result is undefined.
Let"s put dx=x and dy=y.
f(x,y)=pi()-pi()/2*(1+sign(x))* (1-sign(y^2))-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
The angle is from 0 to 2pi.
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
add a comment |
A formula of atan that is working when dx or dy=0.
when dx=dy=0 the result is undefined.
Let"s put dx=x and dy=y.
f(x,y)=pi()-pi()/2*(1+sign(x))* (1-sign(y^2))-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
The angle is from 0 to 2pi.
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
add a comment |
A formula of atan that is working when dx or dy=0.
when dx=dy=0 the result is undefined.
Let"s put dx=x and dy=y.
f(x,y)=pi()-pi()/2*(1+sign(x))* (1-sign(y^2))-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
The angle is from 0 to 2pi.
A formula of atan that is working when dx or dy=0.
when dx=dy=0 the result is undefined.
Let"s put dx=x and dy=y.
f(x,y)=pi()-pi()/2*(1+sign(x))* (1-sign(y^2))-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
The angle is from 0 to 2pi.
answered Nov 20 '18 at 13:14
theodore panagos
191
191
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
add a comment |
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
refer: math.meta.stackexchange.com/questions/5020/…
– idea
Nov 20 '18 at 14:05
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f27217%2fwe-have-angle-arctandy-dx-but-what-happens-when-dx-0%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$arctan(infty)=pi/2, arctan(-infty)=-pi/2$ using the standard $arctan$. (take a look at a graph).
– yoyo
Mar 15 '11 at 16:44
And the problem is, if you divide by zero, you don't know whether you get $infty$ or $-infty$ ... or maybe both, one from each side. ANYWAY, the angle is a right angle.
– GEdgar
Aug 22 '11 at 14:42