initial checkin of the new concept approach
[physik/posic.git] / math / math.h
diff --git a/math/math.h b/math/math.h
new file mode 100644 (file)
index 0000000..df8f6af
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * math.h - basic vector calculations
+ *
+ * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
+ *
+ */
+
+#ifndef MATH_H
+#define MATH_H
+
+/* datatypes */
+
+typedef struct s_3dvec {
+       double x;
+       double y;
+       double z;
+} t_3dvec;
+
+/* function prototypes */
+
+int v3_add(t_3dvec *sum,t_3dvec *a,t_3dvec *b);
+int v3_sub(t_3dvec *sum,t_3dvec *a,t_3dvec *b);
+int v3_scale(t_3dvec *result,t_3dvec *a,double s);
+int v3_zero(t_3dvec *vec);
+int v3_set(t_3dvec *vec,double *ptr);
+int v3_copy(t_3dvec *trg,t_3dvec *src);
+int v3_cmp(t_3dvec *a,t_3dvec *b);
+
+#endif