viete-formula

Estimate pi with Viète's formula

Usage no npm install needed!

<script type="module">
  import vieteFormula from 'https://cdn.skypack.dev/viete-formula';
</script>

README

viete-formula

Build Status

Estimate pi with Viète's formula. Converges way faster than the Leibniz series does.

Example

var vieteFormula = require('viete-formula');

vieteFormula(28);
// => 3.141592653589794

Installation

$ npm install viete-formula

API

var vieteFormula = require('viete-formula');

vieteFormula(n)

Estimate pi with Viète's formula. The larger Number n provided, the further the infinite product will go (yielding a more accurate estimate).