summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-02-01 10:02:58 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-02-01 10:02:58 +0000
commitecef8638e0f565059960214f384430b07ce723a2 (patch)
treebe37fe9bd1e8a6389a9f34ea6e454f7fdfaacf2a /tests
parent70151cd3ac52bb8ea3b854adcc7bfc38524d0b36 (diff)
downloadzetacomponents-graph-ecef8638e0f565059960214f384430b07ce723a2.zip
zetacomponents-graph-ecef8638e0f565059960214f384430b07ce723a2.tar.gz
- Added and test method to receive angle between two vectors
Diffstat (limited to 'tests')
-rw-r--r--tests/vector_test.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/vector_test.php b/tests/vector_test.php
index 9dd6a6b..330d607 100644
--- a/tests/vector_test.php
+++ b/tests/vector_test.php
@@ -162,6 +162,32 @@ class ezcGraphVectorTest extends ezcTestCase
);
}
+ public function testVectorAngleCoordinate()
+ {
+ $vector = new ezcGraphVector( 1, 2 );
+ $result = $vector->angle( new ezcGraphCoordinate( 3, 2 ) );
+
+ $this->assertEquals(
+ $result,
+ 0.51914611424652,
+ 'Wrong angle returned',
+ .01
+ );
+ }
+
+ public function testVectorAngleVector()
+ {
+ $vector = new ezcGraphVector( 1, 2 );
+ $result = $vector->angle( new ezcGraphVector( 3, 2 ) );
+
+ $this->assertEquals(
+ $result,
+ 0.51914611424652,
+ 'Wrong angle returned',
+ .01
+ );
+ }
+
public function testVectorAddCoordinate()
{
$vector = new ezcGraphVector( 1, 2 );
OpenPOWER on IntegriCloud