MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_in_unit_circle

Method is_in_unit_circle

maths/pi_monte_carlo_estimation.py:9–14  ·  view source on GitHub ↗

True, if the point lies in the unit circle False, otherwise

(self)

Source from the content-addressed store, hash-verified

7 self.y = y
8
9 def is_in_unit_circle(self) -> bool:
10 """
11 True, if the point lies in the unit circle
12 False, otherwise
13 """
14 return (self.x**2 + self.y**2) <= 1
15
16 @classmethod
17 def random_unit_square(cls):

Callers 1

estimate_piFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected