Skip to content

NoWare-Development/sintable.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

sintable.h

This is the output of SinTableGen.

This header file contains 65536 sin values.

To get sin/cos out of some float you can do it like this:

#include "sintable.h"

// Get value's sin
float get_sin(float a) {
    return SIN_TABLE[(int)(a * 10430.378F) & (unsigned short)0xFFFF];
}

// Get value's cos
float get_cos(float a) {
    return SIN_TABLE[(int)(a * 10430.378F + 16384.0F) & (unsigned short)0xFFFF];
}

About

Sin Table Generated by SinTableGen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages