Skip to main content
100%

Fork of Value of PI

✓ Published1🌍 Public
NNita
Last edited Aug 4, 2025
Created on Aug 4, 2025
Forked from Value of PI

This interactive Monte Carlo simulation estimates the value of pi by randomly placing steel-blue points inside a square and counting how many fall within an inscribed sky-blue circle. Each click of the "Add 100 Points" button appends 100 new circles to an SVG canvas using D3.js selection and append methods, while React state tracks the running totals. The estimate updates in real time, calculated as four times the number of points inside the circle divided by the total points, with the current counts and approximation displayed in a grey overlay panel.

AI-generated description
MIT Licensed

Similar vizzes