This is a demonstration for designing and implementing game programming software based on simple models derived from questions in algebra and trigonometry.
- Section 1.1: Problem
- Section 1.2: Understanding the problem using algebra and logic
- Section 2.1: Establishing a relation model.
- Section 2.2: Solving the problem using the model.
- Section 3.1: Designing software programming pattern.
- Section 3.2: Writing the full pattern using the Automata Theory notations.
The following problem asks to a generalization of finding at which time does two or more vehicles moving with different speeds will meet each other.
-
Since, Bill starts cycling at 2:00PM from his house, while Mary starts cycling at 2:10PM from Bill's house; it follows that, if we let the starting timestamp is
$t_0 = 2:00PM$ , consequently, Bill's time to cover distance$d$ would be$\delta (t_{B}) = t_{d} - t_0$ , while Mary's time to cover the same distance$d$ would be$$\delta(t_{M}) = t_{d} - (t_{0} + 00:10) = (t_{d} - t_{0}) - 00:10 = \delta(t_{B}) - 00:10$$ . -
Converting the
$00:10$ minutes to hours to match the timestamps, one could deduce the relation among both timestamps:
- By back substitution into the equation from Section 1.2, as this limit could be evaluated as:
- The final model shall become:
- To solve the problem and find the timestamp in which both Mary and Bill shall caught one another using the problem demonstrated in the problem statement, one shall substitute Mary's and Bill's constant velocities into the equation, and find the
$\delta(t_B)$ first. - Problem Complication: However, if Mary and Bill are accelerating, one should even find the integral of their acceleration in a specific timestamp to calculate their instantenous speed in the model.
- The final timestamp difference could be calculated as follows from the initial timestamp
$t_0$ :
-
This means that Mary will require
$\frac{1}{2}$ an hour starting from her timestamp (i.e., 02:10PM) to caught-up with Bill, who reaches the same assembly point after a$\frac{2}{3}$ of an hour starting from his timestamp. -
Therefore, the timestamp in which they will meet could be calculated either by considering Bill's timestamp as the initial timestamp, and therefore will add
$\frac{2}{3}$ of an hour to it or by considering Mary's timestamp as the initial timestamp, and therefore will add$\frac{1}{2}$ an hour to it.
- Designing a software that manipulates this mathematical model of this relationship is a daunting task to undergo, and requires problem generalization and abstraction using Particle Models or using Particle theory.
- Consider, Jack, a friend of both Mary and Bill, who arrived at 2:12PM at Bill's House, and he requires to move with a specific speed to catch Bill and Mary at 2:40PM.
- See, the problem is complicated. Thus, we need to derive a generalized formula to handle these issues.
- To simplify the statement, the following is true:
- As the distance is calculated from Bill's house.
- The difference in timestamps are calculated as follows, in which
$t_d$ is the timestamp at the location they will meet, and$t_0$ is the timestamp at which Bill has started cycling from his house$d_0$ :
-
Based on these facts, we could design a state-machine phase that would execute if one or more accelerating particles are at equal distance from the same starting point (Delta(d)-Zero pattern).
-
Furthermore, we could provide the pattern with some useful parameters out of the composition of the Velocity (i.e., the distance, and the calculated timestamp difference from an initial timestamp, and the new timestamp representing the clock).