projects
/
potlatch2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1c070a
)
Add an angle calculation for ways
author
Andy Allan
<gravitystorm@gmail.com>
Tue, 25 Jan 2011 18:52:18 +0000
(18:52 +0000)
committer
Andy Allan
<gravitystorm@gmail.com>
Tue, 25 Jan 2011 18:52:18 +0000
(18:52 +0000)
net/systemeD/halcyon/connection/Way.as
patch
|
blob
|
history
diff --git
a/net/systemeD/halcyon/connection/Way.as
b/net/systemeD/halcyon/connection/Way.as
index f34fb89dfc4d8e70855f4dcb51899aac7f1bf5e9..6a8aa5906626baa46ba8d667473c6b8a0df8b959 100644
(file)
--- a/
net/systemeD/halcyon/connection/Way.as
+++ b/
net/systemeD/halcyon/connection/Way.as
@@
-218,6
+218,16
@@
package net.systemeD.halcyon.connection {
return left;
}
+ public function get angle():Number {
+ var dx:Number = nodes[nodes.length-1].lon - nodes[0].lon;
+ var dy:Number = nodes[nodes.length-1].latp - nodes[0].latp;
+ if (dx != 0 || dy != 0) {
+ return Math.atan2(dx,dy)*(180/Math.PI);
+ } else {
+ return 0;
+ }
+ }
+
internal override function isEmpty():Boolean {
return (deleted || (nodes.length==0));
}