summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2012-10-29 16:50:13 +0100
committerSebastian Reichel <sre@ring0.de>2012-10-29 16:50:13 +0100
commitc36957203af08d44df297478911257c559767cde (patch)
tree78b7f36182f9be4e692b8e8459beb13e385d5a77
parent305dc06de590e4319f782d058e3199435a424218 (diff)
downloadmicrocopterd-c36957203af08d44df297478911257c559767cde.tar.bz2
add degree method to utils
-rw-r--r--utils.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils.vala b/utils.vala
index e204548..fdc0be7 100644
--- a/utils.vala
+++ b/utils.vala
@@ -17,6 +17,10 @@ public double radians(double degree) {
return degree * (Math.PI/180.0);
}
+public double degree(double radians) {
+ return radians * (180.0/Math.PI);
+}
+
public double constrain(double x, double a, double b) {
return a > x ? a : b < x ? b : x;
}