summaryrefslogtreecommitdiff
path: root/numlib/roots.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-07-15 18:00:09 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-07-15 18:00:09 +0200
commit82d1d89d2e68db56890c593a6428cdcbed1105f2 (patch)
tree7341711df7d1dc24bfec7b408e5b1fc3eeba7a10 /numlib/roots.h
parentd27d024c441a3912ac2959dff6183abf0e199d78 (diff)
parent711b90e2fe8e1b842c3181a6909af1e432fe0fdc (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'numlib/roots.h')
-rwxr-xr-xnumlib/roots.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/numlib/roots.h b/numlib/roots.h
new file mode 100755
index 0000000..e14b72d
--- /dev/null
+++ b/numlib/roots.h
@@ -0,0 +1,23 @@
+
+/*
+ * Roots3And4.c
+ *
+ * Utility functions to find cubic and quartic roots,
+ * coefficients are passed like this:
+ *
+ * c[0] + c[1]*x + c[2]*x^2 + c[3]*x^3 + c[4]*x^4 = 0
+ *
+ * The functions return the number of non-complex roots and
+ * put the values into the s array.
+ *
+ * Author: Jochen Schwarze (schwarze@isa.de)
+ * (From Graphics Gems I)
+ */
+
+int SolveQuadric(double c[3], double s[2]);
+
+int SolveCubic(double c[4], double s[3]);
+
+int SolveQuartic(double c[5], double s[4]);
+
+