File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 9
9
#define INV_TWO_PI 0.15915494309189533576876437577476f
10
10
11
11
#ifdef MP_SOFT_ATAN2
12
-
13
12
// Approximates atan2(y, x) normalized to the [0,4) range
14
13
// with a maximum error of 0.1620 degrees
15
14
float soft_atan2 ( float y , float x )
@@ -18,8 +17,8 @@ float soft_atan2( float y, float x )
18
17
static const float b = 0.596227f ;
19
18
20
19
// Extract the sign bits
21
- uint32_t ux_s = sign_mask & (( uint32_t ) & )x ;
22
- uint32_t uy_s = sign_mask & (( uint32_t ) & )y ;
20
+ uint32_t ux_s = sign_mask & (uint32_t )x ;
21
+ uint32_t uy_s = sign_mask & (uint32_t )y ;
23
22
24
23
// Determine the quadrant offset
25
24
float q = (float )( ( ~ux_s & uy_s ) >> 29 | ux_s >> 30 );
@@ -30,8 +29,8 @@ float soft_atan2( float y, float x )
30
29
float atan_1q = num / ( x * x + bxy_a + num );
31
30
32
31
// Translate it to the proper quadrant
33
- uint32_t uatan_2q = (ux_s ^ uy_s ) | (( uint32_t ) & )atan_1q ;
34
- return q + (( float ) & )uatan_2q ;
32
+ uint32_t uatan_2q = (ux_s ^ uy_s ) | (uint32_t )atan_1q ;
33
+ return q + (float )uatan_2q ;
35
34
}
36
35
37
36
#endif /* MP_SOFT_ATAN */
You can’t perform that action at this time.
0 commit comments