1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Vectors angle: arctan(4/0) = error?

  1. Feb 23, 2012 #1
    Suppose I have a vector with components 4[itex]_{y}[/itex] and 0[itex]_{x}[/itex], how do I calculate the angle of that vector? arctan(4/0) = error? Am I supposed to just know that any vector with a y component of some value and an x component of 0 will automatically be vertical with a 90 degree angle?

    Edit: I mean, trigonometrically, I think I understand why it would be 90 degrees (just looking at the unit circle), but just want to confirm that this is the in fact the case everytime since it's looking like a calculator is not going to help.
    Last edited: Feb 23, 2012
  2. jcsd
  3. Feb 23, 2012 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Well, using a formula meant for positive x won't work when x is negative or zero. This is why you need to pay attention to such things. :smile:

    If you know where that formula comes from, it should be fairly easy to work out other formulas.

    It should also be straightforward to convert the problem you're actually asking about into a new problem that you can use that formula with, and then use the answer to the new problem to solve the original problem.

    That said, various settings offer the function atan2 which is meant specifically to turn (x,y) coordinates into an angle. You might also have arg if you instead use a complex number coordinate for points on the plane.
  4. Feb 23, 2012 #3
    Yes, you are supposed to know that a vector pointed along your axis is just that, a vector pointed along your axis. It doesn't really even make sense to talk about in angle until you bring in more context.
  5. Feb 23, 2012 #4
    I can only think of two possible formula you may be referring to.


    and somehow using this to come up with something other than arctan = (4/0)

    or, the only other thing I can think of would be to think of a right triangle and use the inverse of tan, so that:

    cot[itex]^{-1}[/itex] = (0/4)

    However, I see no function on my calculator that will allow me to evaluate arccos.

    The thing I was thinking about when referring to the unit circle is the fact that when x is zero, the radius always points up toward 2/∏ (90 degrees). But I know of no actual formula that would allow me to calculate arctan = y/0

    Can you give me some idea?
  6. Feb 24, 2012 #5
    You mean pi/2. Hurkyl's point is that you're using equations without really even giving them thought. tanØ is defined as the ratio of the component opposite your base angle to the component adjacent your base angle. You don't have to be so strict in defining your x-y coordinate system and angle. x can be up, y can be right, whatever you want. You can make angles whatever you want, as long as you describe your system correctly you're free to choose any coordinates and any angles.

    I mean, if you're really insisting on blindly using using a formula why not just say sinØ=y/r (defining sinØ in terms of the unit circle with theta being the angle going clockwise between the radius and the x-axis), and it's obvious that y=r, so sinØ=1 and Ø=pi/2 with respect to the x-axis.

    However, it's ridiculous to insist on going directly to a formula, and it's equally ridiculous to insist that you have to define an angle with respect to the x-axis.
  7. Feb 24, 2012 #6
    Yea, ∏/2, thanks! Still not exactly sure what you're talking about. Rearranging the axes for the purpose of finding the value of an angle that I otherwise would not be able to find remains a mystery, so for the time being, I guess I'll have to continue to blindly and ridiculously insist on using a formula, especially since it's so obvious that y = r. :) I'll ask my professor the next ime I see him as i'm sure he won't mind breaking it down during his office hours. I look forward to learning more about the concept you are aluding to. Appreciate your help :)
  8. Feb 24, 2012 #7
    Sorry, enough years of only math/physics can give one a disconnect. I'm not trying to be condescending, only trying to get you out of the 'everything is a formula' mode. In highschool, I too used the same everything is described through formulas mode, and I know in hindsight I should have been taught or told otherwise. I know that at one point I too was still trying to get the idea of vectors straight, and it's only because I've worked with them day in and day out that their form becomes second nature.

    I could for example, define an angle from the y-axis to a vector. Say, for illustrative purposes, that the vector is 3x+4y. If I define an angle to be between the y axis and the vector then the angle is given by arctan(3/4). Similarly, still defining the angle to be with respect to the y axis, if the vector was 0x+4y, then arctan(0/4) gives Ø=0. So in this definition of angle it makes sense to say that a vector that 4y+0x has an angle of 0, i.e. the vector is on the axis that defines the angle.
  9. Feb 24, 2012 #8
    No worries, i'd completely welcome being light years ahead of where I'm currently at if all it meant was, from time to time, experiencing a little disconnect from someone trying to figure things out at the very very basic levels of physics.

    And although I never took "upper" math and science, like trig, calc, or physics, in highschool, I completely agree about 'everything is a formula mode' in schools, as that is what i'm experiencing in my college classes. It seems physics is completely taught to the formula, and the pace of the class is so fast that its difficult to take a step back and really delve into, discover and digest any one topic so as to make it truly intuitive. It seems like that's just the name of the game... seems like the school places more importance on the grade than the comprehension. My opinion at the moment is that for the beginning physics learner, a tough college physics class is not where you are going to really comprehend physics, just where you may memorize a bunch of formulas and then from there, memorize which formula to pick for some particular word problem without understanding what it all really means. That is my experience so far and it seems to be the experience of many of the students in my class. If you want to pass the class, you can't give yourself time to actually digest the concepts; you have just enough time to learn which formulas to apply to which questions. Then you go to cramster, copy and paste the answers to the homework, which are worth 50 percent of the grade, so nobody is really learning anything. And if you actually want to take the time to fully comprehend a topic, you have to prepare for a lower grade. Its a tough sacrifice for someone first getting into physics. Perhaps i'm being overly critical and being biased towards my own situation. I wish I had found interest or understood the importance/relevance of science and math when I was younger so that, perhaps, now in college, i'd be more familiar with the formulas and be able to spend more time exploring the actual content in a much more comprehensive way.

    Anyways, I'm doing what I think is important now, which is avoiding, as much as I can, the mode of "everything is a formula" that you described.

    Thanks for your help on seeing how to find the angle when the horizontal component is zero, it makes complete sense now. Thanks.
    Last edited: Feb 24, 2012
  10. Feb 25, 2012 #9


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Hi, yes. You pretty much had answered your own question from the start. :smile:

    Just be aware that sometimes it might be a negative 90° angle -- which you could tell by seeing if the y-component is negative rather than positive.
  11. Mar 9, 2012 #10
    As a programmer I understand this desire to keep things to a single formula. In code it is good to test for zero on division and make a judgement on the interpretation of the situation. In terms of this problem, if the calculations were using IEEE 754, there are representations for positive and negative infinity, so under these conditions you may not need to check for zero as a special case, the formula you supply might actually work.

    The case you give should be in your test suite as runtime errors are not good, especially where there is a reasonable alternative.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook