Passed
Push — extents ( f35511...ba1d5f )
by Doug
61:44
created

GeographicGeoidHeightGrid::getHeightAdjustment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * PHPCoord.
4
 *
5
 * @author Doug Wright
6
 */
7
declare(strict_types=1);
8
9
namespace PHPCoord\CoordinateOperation;
10
11
use PHPCoord\GeographicPoint;
12
use PHPCoord\UnitOfMeasure\Length\Length;
13
use PHPCoord\UnitOfMeasure\Length\Metre;
14
15
abstract class GeographicGeoidHeightGrid extends Grid
16
{
17
    /**
18
     * @return Metre[]
19
     */
20
    abstract public function getValues(float $x, float $y): array;
21
22
    public function getHeightAdjustment(GeographicPoint $location): Length
23
    {
24
        return $this->getValues($location->getLongitude()->asDegrees()->getValue(), $location->getLatitude()->asDegrees()->getValue())[0];
25
    }
26
}
27