Code Duplication    Length = 18-18 lines in 2 locations

src/LatLng.php 2 locations

@@ 133-150 (lines=18) @@
130
     * "A Guide to Coordinate Systems in Great Britain"
131
     * @return LatLng
132
     */
133
    public function toOSGB36(): LatLng
134
    {
135
        if ($this->refEll == RefEll::airy1830()) {
136
            return $this;
137
        }
138
139
        $asWGS84 = $this->toWGS84();
140
141
        $tx = -446.448;
142
        $ty = 125.157;
143
        $tz = -542.060;
144
        $s = 0.0000204894;
145
        $rx = deg2rad(-0.1502 / 3600);
146
        $ry = deg2rad(-0.2470 / 3600);
147
        $rz = deg2rad(-0.8421 / 3600);
148
149
        return $asWGS84->transformDatum(RefEll::airy1830(), $tx, $ty, $tz, $s, $rx, $ry, $rz);
150
    }
151
152
    /**
153
     * Convert this LatLng object to ED50 datum.
@@ 206-223 (lines=18) @@
203
     * "Making maps compatible with GPS"
204
     * @return LatLng
205
     */
206
    public function toIreland1975(): LatLng
207
    {
208
        if ($this->refEll == RefEll::airyModified()) {
209
            return $this;
210
        }
211
212
        $asWGS84 = $this->toWGS84();
213
214
        $tx = -482.530;
215
        $ty = 130.596;
216
        $tz = -564.557;
217
        $s = -0.00000815;
218
        $rx = deg2rad(-1.042 / 3600);
219
        $ry = deg2rad(-0.214 / 3600);
220
        $rz = deg2rad(-0.631 / 3600);
221
222
        return $asWGS84->transformDatum(RefEll::airyModified(), $tx, $ty, $tz, $s, $rx, $ry, $rz);
223
    }
224
225
    /**
226
     * Convert this LatLng object to WGS84 datum