Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.

Genbox/ApproximationNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Approximation.NET - An implementation of approximations to common trigonometric functions

Features

  • Sine and cosine approximations using polynominals with both low and high precisions.
  • Sine approximation using Taylor series
  • Fast inverse square root (1/sqrt()) function using smart bitshifting
  • All written in C#

Examples

static void Main(string[] args)
{
	float realInvSqrt = (float)(1 / Math.Sqrt(5));
	float approxInvSqrt = Approximation.InvSqrt(5);

	Console.WriteLine("Real: " + realInvSqrt);
	Console.WriteLine("Approximated: " + approxInvSqrt);
}

Output:

Real: 0.4472136
Approximated: 0.447141

For more examples, take a look at the Approximation.NET Client included in the project.

About

A sin(), cos() and inverse sqrt approximation library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages