# Motion Tracking with Vector Velocity

Turn two position samples into direction, speed, and a useful motion note for games, robots, camera tracking, or sensor logs.

## Outcome
Compare two positions, compute the delta vector, divide by elapsed time, and explain speed and direction without hiding units or uncertainty.

## Safe first step
Write the two positions, units, and elapsed time before calculating speed or smoothing the track.

## Ladder steps
### 1. Name both samples
A motion claim starts with two positions in the same coordinate system.

Check: Your note lists before/after position, units, and timestamps or frame numbers.

### 2. Subtract to get movement
The delta vector points from the earlier position to the later position.

Check: You can say which way the object moved and how far in project units.

### 3. Divide by elapsed time
Velocity is movement per second, per frame, or per sample interval.

Check: Your speed uses the same units as the position and the real time interval.

### 4. Inspect jitter before smoothing
Trackers, cameras, sensors, and game loops can produce noisy positions.

Check: Your note says what raw motion looked like before applying any smoothing.

### 5. Repeat before claiming behavior
Two samples give one clue. More samples show whether motion is stable, accelerating, or unreliable.

Check: Your conclusion names what the short sample can and cannot prove.

## Examples
### Find the movement arrow
```sh
delta = position_now - position_before
```
Expected signal: The result points from the old position toward the new one

Caution: Do not subtract values from different coordinate systems.

### Turn movement into speed and direction
```sh
velocity = delta / elapsed_seconds
```
Expected signal: Velocity keeps direction while scaling by time

Caution: Do not assume every frame has the same duration unless you measured it.

### Smooth only after reading the raw track
```sh
raw_positions -> delta_vectors -> optional_smoothing
```
Expected signal: The smoother may reduce jitter but can hide quick turns

Caution: Keep raw samples in the note.

## Common traps
- Mixing pixels, meters, degrees, or grid cells without naming units.
- Assuming a constant frame rate when the sample interval changed.
- Normalizing the vector when speed magnitude matters.
- Smoothing first and losing the evidence of tracker jitter.
- Claiming a motion pattern from only two noisy samples.

## Practice task
Enter a current point, target point, and speed in the graph widget. Then write the delta vector, length, unit direction, next position, and what extra samples you would need before trusting the motion.

## Next steps
- Use the vector page when the direction arrow itself is unclear.
- Use interpolation when you need a point between two known states.
- Use basic sensor statistics when noisy position samples need summary and repeat checks.
- Save the Obsidian note with [[Vector]], [[Velocity]], [[Delta]], [[Elapsed Time]], [[Frame Rate]], [[Motion Tracking]], and [[Smoothing]] backlinks.

## Related
- [Vectors for maker projects](/learn/vectors-for-maker-projects/)
- [Interpolation for motion and controls](/learn/interpolation-for-motion-and-controls/)
- [Basic statistics for sensor logs](/learn/data/basic-statistics-for-sensor-logs/)
- [Build a first Godot game loop](/projects/build-first-godot-game-loop/)
- [Godot input actions](/learn/godot-input-actions-first-pass/)
- [Maker Math routes](/topics/math/)
- [Games and interactive tools](/topics/games/)
- [Applied Data topic group](/topics/data/)

## Obsidian backlinks

Use these wiki links to connect this note inside a local maker vault:

- [[TopicLadder]]
- [[Maker Learning]]
- [[Motion Tracking with Vector Velocity]]
- [[Maker Math]]
- [[math]]
- [[applied-foundation]]
- [[Name both samples]]
- [[Subtract to get movement]]
- [[Divide by elapsed time]]
- [[Inspect jitter before smoothing]]
- [[Vectors for maker projects]]
- [[Interpolation for motion and controls]]

## Source and next routes

Source: https://topicladder.com/learn/motion-tracking-vector-velocity/

- [Vectors for maker projects](/learn/vectors-for-maker-projects/)
- [Interpolation for motion and controls](/learn/interpolation-for-motion-and-controls/)
- [Basic statistics for sensor logs](/learn/data/basic-statistics-for-sensor-logs/)
- [Build a first Godot game loop](/projects/build-first-godot-game-loop/)
- [Godot input actions](/learn/godot-input-actions-first-pass/)
- [Maker Math routes](/topics/math/)
- [Games and interactive tools](/topics/games/)
- [Applied Data topic group](/topics/data/)
