示例#1
0
 public function divideArray(array $xy)
 {
     list($x, $y) = PointUtil::parseArray($xy);
     if ($x) {
         MathUtil::validateDivisor($x);
         $this->x /= $x;
     }
     if ($y) {
         MathUtil::validateDivisor($y);
         $this->y /= $y;
     }
     return $this;
 }
示例#2
0
 public function withDividedArray(array $xy)
 {
     list($x, $y) = PointUtil::parseArray($xy);
     $point = clone $this;
     if ($x) {
         MathUtil::validateDivisor($x);
         $point->withDividedX($x);
     }
     if ($y) {
         MathUtil::validateDivisor($y);
         $point->withDividedY($y);
     }
     return $point;
 }