Passed
Push — master ( 0baa7a...f13449 )
by Doug
50:51
created

GeographicGeoidHeightGrid   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 10
ccs 2
cts 3
cp 0.6667
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHeightAdjustment() 0 3 1
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\Point\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 16
    public function getHeightAdjustment(GeographicPoint $location): Length
23
    {
24 16
        return $this->getValues($location->getLongitude()->asDegrees()->getValue(), $location->getLatitude()->asDegrees()->getValue())[0];
25
    }
26
}
27