Living under attack in a one-dimensional virtual world

We present a kinematics problem in the framework of a videogame. Students are asked to find possible extensions of a safety zone on the x -axis to the right of an indestructible defense wall of height h placed at x = d in which the point-like balls, fired by strange attackers from the origin O of an Oxy reference system, cannot fall. We solve this problem analytically and suggest generalizations. This exercise may be appealing to students who play videogames, since it is proposed by recalling typical situations in simple virtual reality. Palavras-chave: kinematics, computer games, projectile motion.


The problem
In a two-dimensional (2D) videogame point-like Natives (NTs) live in their one-dimensional homeland placed in the interval [d, R] of the x -axis of an Oxy coordinate system.In order to protect themselves from Strange Attackers (SAs) the NTs erect a wall of height h at the left border x = d.In fact, the SAs have a cannon, placed at the origin O of the x-y plane, with which they continuously fire point-like balls at a fixed initial speed V 0 , such that where g is the acceleration due to gravity in the real world.The dreadful cannon is thus calibrated to fire particles able to reach the outermost point of the NT homeland.If the wall were not present, a portion of the homeland of the NTs would be endangered and inhospitable, due to SAs continuous attacks.The tiny balls are launched by the cannon in O at a random value of the angle ϕ, with 0 < ϕ < π/2.
In order to plan a tranquil life, the NTs are forced to calculate the extension of the safe land in which they can construct their point-like houses and move safely.
The student are thus asked to find an acceptable solution the problem and to present the results to the NT community with the aid of graphics software applications

Shielding continuous attacks
In order to solve the problem, we first consider all possible parabolas which can be obtained by fixing the value of the initial velocity V 0 .By the procedure followed in Appendix, we can define the security parabola y S (x) (dashed black line in Fig. 1) as follows The tiny balls have no access, as we can also see from Fig. 1, to points outside the security parabola.However, if no wall is constructed at x = d at the left border of the NT homeland, all points on the x -axis can be reached by the tiny balls launched by the dreadful cannon.For opportunity reasons, we may take the height h not to exceed a certain height.Of course, if the NTs were able to construct a wall of height 2R , all points in the NT homeland to the right of x = d would be safe, since all tiny balls following the parabolas would hit against the wall and could be thus neutralized.Therefore, in what follows we shall only take into account cases for which h ≤ R 2 −d 2 2R .We therefore consider the two trajectories which are able to barely overcome the wall by passing through point (h, d ).These two trajectories are represented by a red and a blue dashed parabola in Fig. 2. The ball following the red trajectory, characterized by a launching angle ϕ 2 is seen to hit the ground in a point of abscissa G − .On the other hand, the ball following the blue trajectory, characterized by a launching angle ϕ 1 , is seen to hit the ground in a point of abscissa G + .Recognizing that the land in the interval (G − , G + ) is unsafe, we shall analyze the safety of two intervals, named West Land (WL) and East Land (EL), at the left and right border, respectively: d < x < G − and G + < x < R.
A general trajectory in our case can be described by the following parabola [1] Figure 1 -Point-like balls are thrown at different angles with the same speed V 0 from the origin O.One notices that all parabolic trajectories (red, blue green, orange, and cyan dotted lines) of these balls are enclosed within the parabolic envelope (security parabola) reported as a black dashed line.In this diagram R = 10 length units.
By now setting y(d ) = h, we get the following two solutions for tan ϕ The above solution tells us that solutions are possible for , as assumed before.Imagining that these conditions are satisfied, we notice that By combining Eq. ( 4) and Eq.(5-6), we finally obtain the solution the abscissas G -and We can now decide on the safety of the WL and of the EL in the following way.First plot the general curve G (ϕ) = R sin 2ϕ.On this curve, corresponding to the values ϕ 1 and ϕ 2 determined by Eq. (4) on the abscissa, pick up the quantities G + and G − on the ordinate, as shown in Figs.3a and 3b for R = 1000, d = 500, and h = 200 and 300, respectively, in arbitrary length units.We do not specify the units purposely, intending meters or kilometers, depending on the characteristic scale in which the NTs and SAs live.Then, we notice that there are two possibilities.In the first case (as in Fig. 3a) the value ϕ = π 4 is included in the interval (ϕ 1 , ϕ 2 ).In the second case (Fig. 3b), the value ϕ = π 4 is not included in the interval (ϕ 1 , ϕ 2 ).In the first case the wall is not high enough to provide safety in the East Land and only a small portion of the West Land under the wall becomes safe.This can be understood from Fig. 3a as follows.In the blue portion of the curve the projectiles are shot either at a too low angle (left side) or at a too high angle (right side) to reach the wall.All shots at angles ϕ comprised between ϕ 1 and ϕ 2 can overcome the wall and reach the NTs' homeland.In this way, only a small green portion of the curve on the right of the axis ϕ = π 4 faces a green part on the left of the same axis, while the red portion occupies the rest of the landscape, making it unsafe up to x = R.Therefore, in this case only the WL (d < x < G − ) is safe.If we increase the height of the wall to h = 300, however, we can recover some safe land also in the EL (G + < x ≤ R), as shown in Fig. 3b.In this case, in fact, the interval (ϕ 1 , ϕ 2 ) does not include the value ϕ = π 4 .In this way, there are two regions having facing green portions of the curve on both sides of the sym-metry axis ϕ = π 4 : the lower one is the WL, the upper one the EL.Therefore, erecting a higher wall does not only provide an increase of the extension of the WL, but also the appearance of a safety area on the other side of the landscape, the EL (G + < x ≤ R).
An additional comment is in order, in case we would like to discuss the statistical properties of the problem.We first notice that, in case the wall would not be present, each point on the ground comprised in the open interval (0, R) could be reached by inclining the cannon at two different angles whose sum is π 2 [2].This properties can be inferred by noting that Figs.3a-b have a vertical symmetry axis at ϕ = π 4 .Therefore, projections of the portion of the curve in Figs.3a-b, described by different colors, can give the following combinations: green-green (safe area); red-red and red-green (unsafe area whose points may be reached by inclining the cannon at two different angles or at one specific obtuse angle, respectively); blue-blue (thrown balls do not reach the wall and fall within the SAs' homeland borders).In the following section we shall make more quantitative calculations of the extensions of the safe areas.

Extension of the safe area
Considering that the NTs' cannot build very high walls, since we have hypothesized that h ≤ R recalling that the EL appears only if the value ϕ = π 4 is not included in the interval (ϕ 1 , ϕ 2 ).⌈ Notice now that the quantities ∆S W L and ∆S EL depend both on h and d We therefore propose the following graphical analysis.By recalling that the functions ∆S W L and ∆S EL are defined in the two-dimensional interval of the first quadrant of the hd -plane in which h ≤ R 2 −d 2 2R , we again fix R = 1000 In the case of ∆S EL , we need to exclude the additional portion of the hdplane for which ϕ 1 > π/4.Therefore, we may represent ∆S W L and ∆S EL on the hd -plane analytically as in Figs. 4 a-b In these figures, we show a contour plot for these functions in terms of h and d In this type of plot all points on a given contour take on the same functional value; darker shaded regions take on lower values than lighter ones.By this analysis we notice that the amplitudes ∆S W L and ∆S EL follow different patterns.In fact, while higher walls give, for not too small distances, higher value of ∆S W L , the same is not true for ∆S EL .In order to illustrate this point, let us fix the distance to 200 (arbitrary units).For small heights of the wall, we notice that the longitudinal size of the WL is small (we are in a dark region of the contour plot), while the EL does not exist.As h increases, the amplitude of the WL steadily increases, and the EL starts increasing from zero.This analysis therefore tells us that the highest the wall the highest the value of ∆S W L and ∆S EL .However we may notice that if the cannon is placed too close to the wall, no matter how high the wall we build (respecting the limit h ≤ R 2 ), the value of ∆S W L (Fig. 4a) will remain in the darkest region.On the other hand, the value of ∆S EL (Fig. 4b) will always be rather high, being the graph in the light region for very small values of d.As a final example, let us consider the total extension of the safe territory of the Natives as represented in Fig. 5 In this case we notice that it is possible to decide, depending on the distance d, how much land could be made safe by building a high enough wall.

Conclusions
A kinematics problem in two dimensions is proposed in the framework of typical virtual world situations.In this way, young students who often play with videogames can be stimulated to propose new scenarios for even more interesting cases.Moreover, undergraduate students in computer science interested in physical scenarios, might find this application useful for other uses in videogame applications.
As a first possible generalization of the present analysis we notice that the defense wall has been considered indestructible.Students may suggest to remove this hypothesis.Therefore, because of the randomness of all launches made by the Strange Attackers, an average repair time depending on the wall durability could be found.On the other hand, we can immediately foresee other possible generalizations.We just make two additional brief examples.In a first variation on the theme, we might allow the point-like Natives to move in a two-dimensional landscape.In a second, the Strange Attackers can be allowed to place their cannon slightly above or below the origin O.
All these situations can be tackled and solved by the same type of analysis shown in the present work.Considering the type of computer assisted graphical analysis here adopted, the problem can be proposed in a Physics course for advanced High School students or for first year College students.

Figure 2 -
Figure 2 -A point-like ball is thrown at two different angles with the same speed V 0 from the origin O.Both trajectories pass through point (d, h).

Figure 3 -
Figure 3 -Definition of the safety area for R = 1000 and d = 500 (dotted line level) in arbitrary length units.In (a) h = 200, in (b) h = 300.We notice that for h = 200 only a small safety area (projection on the ordinate of the green portion on right) is present in the West Land, while the rest of the landscape is unsafe (projection on the ordinate of the red portion of the curve).When the wall height is increased to h = 300 in (b), a small portion of the East Land becomes safe and the extension of the safety area in the West Land increases.
2 −d 2 2R , and noting that SAs' can come close enough to the wall with their cannon, being d ≤ √ R (R − 2h) by the same inequality, we are left with the following question: considering R fixed, what would be the total extension ∆S of the safe areas (WL and/or EL) shadowed by the indestructible wall?We could answer to this question by finding the length of the intervals (d, G − ) and, in case the EL is present, of the interval (G + , R].Therefore, we may set

Figure 4 -
Figure 4 -Contour plot for ∆S W L (a) and ∆S EL (b) as a function of h and d.For every contour line we have the same value of the function.As the color becomes lighter, the value of the function increases.

Figure 5 -
Figure 5 -Contour plot for the total extension of safe territory ∆S W L + ∆S EL as a function of h and d.For every contour line we have the same value of the function.As the color becomes lighter, the value of the function increases.