Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SinCosTable types #7036

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

amcolash
Copy link

@amcolash amcolash commented Feb 10, 2025

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

  • Updates the Documentation
  • Fixes a bug

Describe the changes below:

The types for SinCosTable are incorrect. I fixed them since I think this might be helpful in my game, so I wanted to share a quick fix!

Cheers!

Edit:

Now that I look at the actual source code and values generated, I am not entirely sure what this function is actually doing. Ended up just using my own table which gives values that make a lot more sense to me.

export function generateCosTable(size: number): number[] {
  const cosTable = [];
  for (let i = 0; i < size; i++) {
    cosTable.push(Math.cos((i / size) * Math.PI * 2));
  }
  return cosTable;
}

The PR is still relevant to fixing types though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant