VectorUtilsAngleBetweenTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAngleBetween() 0 13 1
1
<?php
2
3
namespace PHP\Math\VectorTest;
4
5
use PHP\Math\Vector\Vector;
6
use PHP\Math\Vector\VectorUtils;
7
use PHPUnit_Framework_TestCase;
8
9
class VectorUtilsAngleBetweenTest extends PHPUnit_Framework_TestCase
10
{
11
    public function testAngleBetween()
12
    {
13
        // Arrange
14
        $vector1 = new Vector(array(1, 0, 0));
15
        $vector2 = new Vector(array(0, 1, 0));
16
17
        // Act
18
        $angle = VectorUtils::angleBetween($vector1, $vector2);
19
20
        // Assert
21
        $this->assertInternalType('float', $angle);
22
        $this->assertEquals('1.5707963267948966', $angle);
23
    }
24
}
25