ehime

Untitled

Sep 6th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <?php
  2.  
  3. Namespace Bonding
  4. {
  5.     USE \Action\Throwable AS Throwable;
  6.  
  7.     define('DADS_LOCATION', array(1, 1));
  8.     define('STATIC_POINT',  5);
  9.  
  10.     Class Ball Extends Throwable
  11.     {
  12.         public  $target, $ball;
  13.         private $location = array();
  14.  
  15.         // get your own bonding moment asshole
  16.         private function __clone {}
  17.  
  18.         public function __construct($target)
  19.         {
  20.             $this->target   = $target;
  21.             $this->ball     = $ball;
  22.  
  23.             parent::__construct($this);
  24.         }
  25.  
  26.         public function aim()
  27.         {
  28.             if ($this->ball instanceof Ball)
  29.             {
  30.                 try {
  31.  
  32.                     parent::throws($this->ball);
  33.  
  34.                 } catch (Exception $ball) {
  35.                     $this->target($this->ball);
  36.                 }
  37.  
  38.                 if (! empty($this->target)) $this->aim());
  39.             }
  40.         }
  41.  
  42.         private function target()
  43.         {
  44.             if ($this->ball instanceof Ball)
  45.             {
  46.                 $dx = 0;
  47.                 $dy = 0;
  48.  
  49.                 $ex = DADS_LOCATION[0] * DADS_LOCATION[1];
  50.                 $ey = DADS_LOCATION[1] * STATIC_POINT;
  51.  
  52.                 $a  = DADS_LOCATION[0];
  53.                 $b  = DADS_LOCATION[1];
  54.                 $c  = STATIC_POINT;
  55.  
  56.                 $cosd  = $ex * $b;
  57.                 $cosfi = (($a ^ 2) + ($b ^ 2) - ($c ^ 2) / (2 * $a * $b));
  58.  
  59.                 $d     = acos($cosd);
  60.                 $fi    = acos($cosfi);
  61.  
  62.                 return $fi - $d;
  63.             }
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment