1
2extern crate skspringrs;
3use skspringrs::*;
4
5fn sixtyfour() {
6 let spring = DampedSpringController::<f64>::with_coefficients(1.0, 10.0, 10.0);
8 let mut v: f64 = 0.0;
9 let mut p: f64 = 0.0;
10
11 for _i in 0..10 {
12 spring.update(&mut p, &mut v, 100.0);
13 print!("{}\n", p);
14 }
15}
16
17fn thirtytwo() {
18 let spring = DampedSpringController::<f32>::with_coefficients(1.0, 10.0, 10.0);
20 let mut v: f32 = 0.0;
21 let mut p: f32 = 0.0;
22
23 for _i in 0..10 {
24 spring.update(&mut p, &mut v, 100.0);
25 print!("{}\n", p);
26 }
27}
28
29fn main() {
30 sixtyfour();
31 thirtytwo();
32}
33