Skip to content

rudyorahin/Piapproximation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

PI Approximation in Java

Description

This project provides a Java application to approximate the value of Pi using Monte Carlo simulation. The approximation is calculated based on the number of randomly generated points that fall inside a unit circle divided by the total number of points.

Features

  • Approximates the value of Pi
  • Displays the approximation difference compared to Java's Math.PI
  • JUnit test for validation

Setup

To get started, clone the repository to your local machine:

git clone https://github.com/YourGithubUsername/PIapproximation.git

Navigate to the src/main/java/edu/gcccd/csis directory to find the source files.

Usage

Compile and run the PIapproximation.java file. The application will prompt you to enter the number of points to use for the approximation. Here's how it works:

  1. Compile the code:
javac PIapproximation.java
  1. Run the program:
java PIapproximation

Running Tests

Navigate to the src/test/java/edu/gcccd/csis directory and run the PIapproximationTest.java to validate the approximation within a given margin of error.

License

Copyright © 2023 Rudy Orahin. Licensed under the MIT License. See LICENSE for more information.

---

Feel free to modify the content to better suit your project. Don't forget to add a `LICENSE` file in your GitHub repository and paste the MIT License text into it, stating you as the copyright holder.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages