<div dir="ltr">Hi Laurent,<div><br></div><div>The differences between acos() and atan2() are on the order of 1e-10,</div><div>so they cannot explain the huge differences that you are seeing in</div><div>your results.  You almost definitely made a mistake in your code, e.g.</div><div>forgetting to normalize a vector.</div><div><br></div><div> - David</div><div><br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 15, 2016 at 8:25 AM, Laurent <span dir="ltr"><<a href="mailto:l.paul@uclouvain.be" target="_blank">l.paul@uclouvain.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear users,<br>
<br>
Sorry to dig up this post, but I'm troubled by the results I get.<br>
I used to use the acos() method until I found out that the resulting values<br>
were poor.<br>
We fixed it using the atan2 method instead. Seems working much better!<br>
<br>
David (Gobbi), could you elaborate a bit on the error when the angle<br>
approaches 0?<br>
I mean, I get huge differences between both methods. As an example, I get<br>
atan2 Vs acos (in degres):<br>
- 3.67 Vs 10.08<br>
- 11.03 Vs 15.82<br>
- 3.24 Vs 20.02<br>
- 7.78 Vs 20.05<br>
- ...<br>
<br>
How to explain these differences?<br>
I've checked if clamp values would give better results but the dot produces<br>
values between -1 and +1.<br>
I've checked multiple times if there was no mistake, and there's not.<br>
I'm horrified!<br>
<br>
Since I use the python/numpy distribution from paraview 4.1,<br>
AngleBetweenVectors in not implmented and I had to reimplement the<br>
calculation; That's why I jumped into it more deeply.<br>
<br>
Thanks,<br>
Laurent.<br></blockquote></div></div></div></div>