Completed
Push — dev ( 80a148...4ac9b0 )
by Jordan
03:47
created

TrigonometryProvider::cartesianDistance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
dl 14
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 3
1
<?php
2
3
namespace Samsara\Fermat\Provider;
4
5
use Samsara\Fermat\Numbers;
6
use Samsara\Fermat\Types\Cartesian;
7
use Samsara\Fermat\Types\Tuple;
8
use Samsara\Fermat\Values\Base\NumberInterface;
9
use Samsara\Fermat\Values\ImmutableNumber;
10
11
class TrigonometryProvider
12
{
13
14 View Code Duplication
    public static function radiansToDegrees($radians)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        $radians = Numbers::makeOrDont(Numbers::IMMUTABLE, $radians);
17
        $pi = Numbers::makePi();
18
        
19
        return $radians->multiply(180)->divide($pi)->getValue();
20
    }
21
22 View Code Duplication
    public static function degreesToRadians($degrees)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $degrees = Numbers::makeOrDont(Numbers::IMMUTABLE, $degrees);
25
        $pi = Numbers::makePi();
26
27
        return $degrees->multiply($pi)->divide(180)->getValue();
28
    }
29
30
}