Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a problem concerning ArcTan drawing a graph using ListPlot. I import a table of data:

a = Import["D:\2_b=10a.txt", "Table"];

Then I write:

ListPlot[Table[{i*0.005 Pi, -ArcTan[(a[[i]][[1]] - 
   a[[i - 1]][[1]]), (a[[i]][[2]] - a[[i - 1]][[2]])]}, {i, 2, 401, 1}]], PlotRange -> {{0, Pi}, {-4, 4}}]

The returned graph looks like

this

I know from the nature of my calculations that the function must be continuous on the interval $[0,Pi]$, but at $3Pi/4$ the ArcTan function goes to another branch, since ArcTan[x,y] chooses a quadrant. How could I possibly try to move the bottom part of the plot up by Pi, so the function is smooth and continuous?

I tried defining a function

myArcTan[x_] := Piecewise[{{ArcTan[x] + Pi, x < 0}, {ArcTan[x], x > 0}}];

but it doesn't work. Thank you very much.

share|improve this question
2  
This or this might help. –  Daniel Lichtblau Aug 14 at 17:42
    
Please upload your data or provide a self-contained example. –  Mr.Wizard Aug 14 at 20:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.