Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] werte;
- int position = 0;
- double ax, ay, az, dt, v0_x = 0, v0_y = 0, v0_z = 0, vvv_x = 0, vvv_y = 0, vvv_z = 0, weg_x, weg_y, weg_z;
- if (variable.Contains("Position"))
- {
- DateTime EndZeit = DateTime.Now;
- TimeSpan GZ = EndZeit - StartZeit;
- StartZeit = DateTime.Now;
- dt = GZ.Ticks/10000;
- if (dt != 0)
- {
- werte = variable.Split(';');
- ax = Double.Parse(werte[1]);
- ay = Double.Parse(werte[2]);
- az = Double.Parse(werte[3]);
- if (position == 0)
- {
- vvv_x = 0;
- vvv_y = 0;
- vvv_z = 0;
- }
- if (position == 1)
- {
- v0_x = (ax * dt) + vvv_x;
- vvv_x = v0_x;
- v0_y = (ay * dt) + vvv_y;
- vvv_y = v0_y;
- v0_z = (az * dt) + vvv_z;
- vvv_z = v0_z;
- }
- if (position == 2)
- {
- weg_x = (1 / 2 * ax * Math.Pow(dt, 2)) + (v0_x * dt);
- weg_y = (1 / 2 * ay * Math.Pow(dt, 2)) + (v0_y * dt);
- weg_z = (1 / 2 * az * Math.Pow(dt, 2)) + (v0_z * dt);
- //Eichen
- weg_x = weg_x / 1000;
- weg_y = weg_y / 1000;
- weg_z = weg_z / 1000;
- //weg an Maus weiterleiten
- MausFunktionRelativ((int)weg_x,(int)weg_y);
- position = 0;
- }
- position++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment