tadd missing line delimiters, elaborate on integration scheme - slidergrid - grid of elastic sliders on a frictional surface
(HTM) git clone git://src.adamsgaard.dk/slidergrid
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit fd19f30421f1a2866fbe554a73b8eff43f786ec5
(DIR) parent e99f679f8b69de849021d65feb2ac5a955d270ba
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Tue, 15 Mar 2016 14:09:34 -0700
add missing line delimiters, elaborate on integration scheme
Diffstat:
M slider.c | 4 +++-
M vector_math.h | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/slider.c b/slider.c
t@@ -8,7 +8,9 @@ void print_slider_position(slider s)
printf("%f\t%f\t%f\n", s.pos.x, s.pos.y, s.pos.z);
}
-/* Explicit temporal integration scheme based on three-term Taylor expansion */
+/* Explicit temporal integration scheme based on three-term Taylor expansion.
+ * Truncation error O(dt^4) for positions, O(dt^3) for velocities. Acceleration
+ * change is approximated by backwards differences. */
void integrate_kinematics(slider s, Float dt, int iteration)
{
s.acc = divide_float3_scalar(s.force, s.mass);
(DIR) diff --git a/vector_math.h b/vector_math.h
t@@ -14,5 +14,5 @@ Float3 divide_float3(Float3 v1, Float3 v2);
Float3 multiply_float3_scalar(Float3 v, Float s);
Float3 divide_float3_scalar(Float3 v, Float s);
Float3 divide_scalar_float3(Float s, Float3 v);
-Float3 add_float3_scalar(Float3 v, Float s)
-Float3 add_scalar_float3(Float s, Float3 v)
+Float3 add_float3_scalar(Float3 v, Float s);
+Float3 add_scalar_float3(Float s, Float3 v);