jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject [5/6] git commit: Add remaining Leviathan trigonometric functions (JENA-507)
Date Thu, 09 Oct 2014 14:55:04 GMT
Add remaining Leviathan trigonometric functions (JENA-507)


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/49fbd69c
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/49fbd69c
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/49fbd69c

Branch: refs/heads/JENA-507
Commit: 49fbd69c79b05fc311c42ed87e47c2dac6c304bc
Parents: f1feb70
Author: Rob Vesse <rvesse@apache.org>
Authored: Thu Oct 9 15:43:24 2014 +0100
Committer: Rob Vesse <rvesse@apache.org>
Committed: Thu Oct 9 15:43:24 2014 +0100

----------------------------------------------------------------------
 .../sparql/function/library/leviathan/cosec.java     | 14 ++++++++++++++
 .../sparql/function/library/leviathan/cosec1.java    | 14 ++++++++++++++
 .../jena/sparql/function/library/leviathan/cot.java  | 15 +++++++++++++++
 .../jena/sparql/function/library/leviathan/cot1.java | 14 ++++++++++++++
 .../jena/sparql/function/library/leviathan/sec.java  | 14 ++++++++++++++
 .../jena/sparql/function/library/leviathan/sec1.java | 14 ++++++++++++++
 .../jena/sparql/function/library/leviathan/sin.java  | 13 +++++++++++++
 .../jena/sparql/function/library/leviathan/sin1.java | 13 +++++++++++++
 .../jena/sparql/function/library/leviathan/tan.java  | 13 +++++++++++++
 .../jena/sparql/function/library/leviathan/tan1.java | 13 +++++++++++++
 10 files changed, 137 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
new file mode 100644
index 0000000..9f83b87
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
@@ -0,0 +1,14 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class cosec extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // cosec x = 1 / sin x 
+        return NodeValue.makeDouble(1 / Math.sin(v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
new file mode 100644
index 0000000..62b1a53
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
@@ -0,0 +1,14 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class cosec1 extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // acosec x = asin (1 / x) 
+        return NodeValue.makeDouble(Math.asin(1 / v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
new file mode 100644
index 0000000..7ca6ba3
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
@@ -0,0 +1,15 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class cot extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // cot x = sin x / cos x
+        double x = v.getDouble();
+        return NodeValue.makeDouble(Math.sin(x) / Math.cos(x));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
new file mode 100644
index 0000000..e1f423f
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
@@ -0,0 +1,14 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class cot1 extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // acot x = atan (1 / x)
+        return NodeValue.makeDouble(Math.atan(1 / v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
new file mode 100644
index 0000000..cad4b35
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
@@ -0,0 +1,14 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class sec extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // sec x = 1 / cos x 
+        return NodeValue.makeDouble(1 / Math.cos(v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
new file mode 100644
index 0000000..fad5437
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
@@ -0,0 +1,14 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class sec1 extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        // arcsec x = acos (1 / x) 
+        return NodeValue.makeDouble(Math.acos(1 / v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
new file mode 100644
index 0000000..c25965a
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
@@ -0,0 +1,13 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class sin extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        return NodeValue.makeDouble(Math.sin(v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
new file mode 100644
index 0000000..2255d06
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
@@ -0,0 +1,13 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class sin1 extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        return NodeValue.makeDouble(Math.asin(v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
new file mode 100644
index 0000000..46d76f4
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
@@ -0,0 +1,13 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class tan extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        return NodeValue.makeDouble(Math.tan(v.getDouble()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/49fbd69c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
new file mode 100644
index 0000000..6fcfa7b
--- /dev/null
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
@@ -0,0 +1,13 @@
+package com.hp.hpl.jena.sparql.function.library.leviathan;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue;
+import com.hp.hpl.jena.sparql.function.FunctionBase1;
+
+public class tan1 extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue v) {
+        return NodeValue.makeDouble(Math.atan(v.getDouble()));
+    }
+
+}


Mime
View raw message