Пример #1
0
 public function dataProvider()
 {
     return array(array(Point::factory(50000, 0), Point::factory(6, 0)));
 }
Пример #2
0
 public function dataProvider()
 {
     return array(array(Point::factory(0, 0), Point::factory(0, 0)), array(Point::factory(0, 0, 0), Point::factory(0, 0, 0)), array(Point::factory(10, 10), Point::factory(10, 10)));
 }
Пример #3
0
 /**
  * Convert from the default value
  *
  * @param \Converter\Geo\Point $value
  *
  * @return \Converter\Geo\Point
  */
 public function fromDefault($value)
 {
     if (!$value instanceof Point) {
         throw new \Converter\Exception\InvalidArgumentException('No valid Point given. Must be instance of \\Converter\\Geo\\Point');
     }
     $hoch = pi() * 2 * self::RADIUS_GREENWICH / 360 * $value->getY();
     $hochDM = cos(deg2rad($value->getY())) * self::RADIUS_EQUATOR;
     $rechts = pi() * 2 * $hochDM / 360 * ($value->getX() - $this->getBaseMeridian()) + $this->getAbweichung();
     return Point::factory($rechts, $hoch);
 }
Пример #4
0
 /**
  * @dataProvider dataProvider
  */
 public function testFactoryWithHeight($p)
 {
     $point = Point::factory($p, $p, $p);
     $this->assertAttributeEquals($p, '_x', $point);
     $this->assertAttributeEquals($p, '_y', $point);
     $this->assertAttributeEquals($p, '_z', $point);
     $this->assertEquals($p, $point->getX());
     $this->assertEquals($p, $point->getY());
     $this->assertEquals($p, $point->getZ());
 }