EquiRectangularProjection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 6
c 1
b 0
f 0
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMaxY() 0 3 1
A getX() 0 3 1
A getMaxLatitude() 0 3 1
A getMaxX() 0 3 1
A getY() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PrinsFrank\PhpGeoSVG\Projection;
6
7
use PrinsFrank\PhpGeoSVG\Geometry\Position\Position;
8
9
class EquiRectangularProjection implements Projection
10
{
11 1
    public function getX(Position $position): float
12
    {
13 1
        return $position->longitude - Position::MIN_LONGITUDE;
14
    }
15
16 1
    public function getY(Position $position): float
17
    {
18 1
        return - $position->latitude - Position::MIN_LATITUDE;
19
    }
20
21 1
    public function getMaxX(): float
22
    {
23 1
        return Position::TOTAL_LONGITUDE;
24
    }
25
26 1
    public function getMaxY(): float
27
    {
28 1
        return Position::TOTAL_LATITUDE;
29
    }
30
31 1
    public function getMaxLatitude(): float
32
    {
33 1
        return 90;
34
    }
35
}
36