## ◆ atan2pi()

 IEEEValue boost::simd::atan2pi ( IEEEValue const & y, const IEEEValue & x )

This function object returns the atan2pi function : atan2 in pi multiples.

Note

For every parameters of same floating type atan2pi(y, x) is similar to: atan2(y, x)/Pi

atan2, atan2pi
Example:
#include <boost/simd/trigonometric.hpp>
#include <boost/simd/pack.hpp>
#include <boost/simd/function/reverse.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
pack_ft qf = bs::reverse(pf);
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> bs::atan2pi(pf, qf) = " << bs::atan2pi(pf, qf) << '\n';
float xf = 2.0f, yf = 3.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> bs::atan2pi(xf, yf) = " << bs::atan2pi(xf, yf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
<- qf = (0.5, -1, 2, 1)
-> bs::atan2pi(pf, qf) = (0.352416, 0.647584, -0.147584, 0.147584)
---- scalar
<- xf = 2
<- yf = 3
-> bs::atan2pi(xf, yf) = 0.187167