Skip to content

Commit 28b3cbe

Browse files
committed
Rework twin_tan with twin_sincos
1 parent 1451af7 commit 28b3cbe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/trig.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ twin_fixed_t twin_cos(twin_angle_t a)
2626

2727
twin_fixed_t twin_tan(twin_angle_t a)
2828
{
29-
twin_fixed_t s = twin_sin(a);
30-
twin_fixed_t c = twin_cos(a);
29+
twin_fixed_t s, c;
30+
twin_sincos(a, &s, &c);
3131

3232
if (c == 0) {
3333
if (s > 0)
@@ -73,7 +73,7 @@ void twin_sincos(twin_angle_t a, twin_fixed_t *sin, twin_fixed_t *cos)
7373
/* limit to [0..360) */
7474
a = a & (TWIN_ANGLE_360 - 1);
7575
int c = a > TWIN_ANGLE_90 && a < TWIN_ANGLE_270;
76-
/* special case for 90 degrees - no room in table */
76+
/* special case for 90 degrees */
7777
if ((a & ~(TWIN_ANGLE_180)) == TWIN_ANGLE_90) {
7878
sin_val = TWIN_FIXED_ONE;
7979
cos_val = 0;

0 commit comments

Comments
 (0)