Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C R is the raduis of the circle y^2 + X^2 = R
- R = sqrt(4.0)
- C num is the number of points (i,j) that i and j are integers :)
- C and is in the boundary of the circle
- num = 0.0
- C we made two loops too scan all the points of the (first quarter)
- C including the (0,1) (0,2) and
- C points are (in this example) : (1,1),(1,2),(2,1),(2,2)
- C cuz we put the maximum is 2 = R ^_^
- do 10 i=0,R
- do 20 j=1,R
- C instR (is the raduis of the current point) we will use the radius
- C to compare if the point is in the circle or not ^_^
- instR = ((i**2) + (j**2) )**(0.5)
- if(instR.LT.R) num = num + 1
- 20 continue
- 10 continue
- C here we multiplied the number * 4 , cuz we have 4 quarters and we
- totalN = (4 * num)+1
- write (*,*)totalN
- pause
- stop
- end
Advertisement
Add Comment
Please, Sign In to add comment