MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / atan2

Function atan2

external/astc-encoder/Source/astcenc_vecmathlib.h:277–282  ·  view source on GitHub ↗

* @brief Return fast, but approximate, vector atan2(x, y). */

Source from the content-addressed store, hash-verified

275 * @brief Return fast, but approximate, vector atan2(x, y).
276 */
277ASTCENC_SIMD_INLINE vfloat atan2(vfloat y, vfloat x)
278{
279 vfloat z = atan(abs(y / x));
280 vmask xmask = x < vfloat::zero();
281 return change_sign(select(z, vfloat(astc::PI) - z, xmask), y);
282}
283
284/*
285 * @brief Factory that returns a unit length 4 component vfloat4.

Callers 2

compute_angular_offsetsFunction · 0.70
TESTFunction · 0.50

Calls 5

atanFunction · 0.85
change_signFunction · 0.85
vfloatClass · 0.85
absFunction · 0.70
selectFunction · 0.70

Tested by 1

TESTFunction · 0.40