Languages
[Edit]
EN

JavaScript - how to use Monte Carlo method to calculate surface area (definite integral)?

8 points
Created by:
JoanneSenior
1070

Using JavaScript it is possible to calculate surface area (definite integral) in following way.

1. Circle surface area calculation example

Edit

Main idea of this method is to:

  1. random big amount of points
  2. check all time if every next one point is inside circle or not,
  3. compute coefficinet by dividing number of points inside of circle by outsie one points
  4. multiply the coefficient by square surface area - this way from proportion it is posible to get aproximated circle surface area.

Note: the longer the simulation is performed, the results are more precised.

References

Edit
  1. Monte Carlo method - Wikipedia
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - math (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join