Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Pi via Monte Carlo Method

Overview

This program calculates an approximation for the value of Pi via Monte Carlo Method by plotting a circle on a 200x200 square area then randomly placing dots on this area.

 

Description

This program calculates an approximation for the value of Pi by plotting a circle on a 200x200 square area then randomly placing dots on this area. By calculating the ratio of points that fall inside versus the number of points that fall outside the circle the value for pi is approximated.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1.  Run the VI
  2. Slide the pointer on the Speed control to control the speed.

 

Additional Information or References

 

 

Front Panel

1.PNG

 

VI Snippet 

2.png

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**