@@ -29,9 +29,9 @@ |
||
29 | 29 | $result = $this->getRandomOrgAPI()->getData($generateIntegers); |
30 | 30 | |
31 | 31 | $this->coordinates = [ |
32 | - 'x' => rad2deg($result[0] * 2 * pi() - pi()), |
|
33 | - 'y' => rad2deg(pi()/2 - acos($result[1] * 2 - 1)), |
|
34 | - 'z' => $result[2] * 1000, |
|
32 | + 'x' => rad2deg($result[0]*2*pi() - pi()), |
|
33 | + 'y' => rad2deg(pi()/2 - acos($result[1]*2 - 1)), |
|
34 | + 'z' => $result[2]*1000, |
|
35 | 35 | ]; |
36 | 36 | |
37 | 37 | return $this; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function run($n = 1000) |
25 | 25 | { |
26 | - $parameters = ['n' => $n * 2, 'decimalPlaces' => 6]; |
|
26 | + $parameters = ['n' => $n*2, 'decimalPlaces' => 6]; |
|
27 | 27 | |
28 | 28 | $GenerateDecimalFractions = (new GenerateDecimalFractions()) |
29 | 29 | ->withParameters($parameters); |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | $inside = 0; |
34 | 34 | for ($i = 0; $i < $n; $i++) { |
35 | 35 | $x = $numbers[$i]; |
36 | - $y = $numbers[$i+1]; |
|
36 | + $y = $numbers[$i + 1]; |
|
37 | 37 | |
38 | 38 | if (sqrt($x*$x + $y*$y) <= 1) { |
39 | 39 | $inside++; |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | - $this->estimation = 4 * $inside/$n; |
|
43 | + $this->estimation = 4*$inside/$n; |
|
44 | 44 | |
45 | 45 | return $this; |
46 | 46 | } |