| 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(-)
--- |
| 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); |
| 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); |