Acessibilidade / Reportar erro

Living under attack in a one-dimensional virtual world

(Vivendo sob ataque num mundo virtual unidimensional)

Abstracts

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.

Keywords:
cinemática; videogames; movimento de um projétil


Apresentamos um problema de cinemática no âmbito de um videogame. Os alunos são convidados a encontrar eventuais prolongamentos de uma zona de segurança no eixo-x, à direita de um muro de defesa indestrutível de altura h, colocado em x= d, em que as bolas pontuais, disparadas por atacantes estranhos a partir da origem O de um sistema de referência Oxy, não podem cair. Resolvemos esse problema analiticamente e sugerimos generalizações. Este exercício pode ser atraente para os alunos que jogam videogames, uma vez que são propostas situações típicas de uma realidade virtual simples.

Palavras-chave:
kinematics; computer games; projectile motion


1. 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 speedV0, such that

(1) R = V 0 2 g ,

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

2. 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 V0. By the procedure followed in Appendix, we can define the security parabola yS(x) (dashed black line in Fig. 1) as follows

(2) y S x = R 2 - x 2 2 R .
Figure 1
Point-like balls are thrown at different angles with the same speed V0 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.

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 h>ySd=R2-d22R, 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 hR2-d22R.

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.

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

A general trajectory in our case can be described by the following parabola [1[1] F.W. Sears, M.W. Zemansky and H.D. Young, University Physics (Addison-Wesley, Reading, 1977), 5thed.]

(3) y x = x tan ϕ - 1 + tan 2 ϕ 2 R x 2 .

By now setting y(d) = h, we get the following two solutions for tan ϕ

(4) tan ϕ 1 , 2 R R 2 d 2 2 h R d ,

The above solution tells us that solutions are possible for dRR-2h, or hR2-d22R, as assumed before. Imagining that these conditions are satisfied, we notice that

(5) G + = 2 R tan ϕ 1 1 + tan 2 ϕ 1 = R sin 2 ϕ 1 ,
(6) G - = 2 R tan ϕ 2 1 + tan 2 ϕ 2 = R sin 2 ϕ 2 .

By combining Eq (4) and Eq. (Eq (5)Eq (6)), we finally obtain the solution the abscissasG and G+

(7) G + = d 2 + h ( R R 2 d 2 2 h R ) d 2 + h 2 d ,
(8) G - = d 2 + h ( R R 2 d 2 2 h R ) d 2 + h 2 d .

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 ϕ2determined 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 ϕ=π4is included in the interval (ϕ1, ϕ2). In the second case (Fig.3b), the value ϕ=π4is 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 ϕ=π4faces 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.

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.

If we increase the height of the wall to h = 300, however, we can recover some safe land also in the EL (G+ < xR), 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 symmetry 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+ < xR).

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][2] D. Halliday, R. Resnick and J. Walker, Fundamentals of Physics (John Wiley & Sons, New York, 2005), 7thed.. 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.

3. Extension of the safe area

Considering that the NTs' cannot build very high walls, since we have hypothesized that hR2-d22R, and noting that SAs' can come close enough to the wall with their cannon, being dRR-2hby 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

(9) Δ S W L = G d = R h R 2 d 2 2 h R d 2 + h 2 h d .
(10) Δ S E L = R - G + = h 2 R + d 2 R - d - h d R + R 2 - d 2 - 2 h R d 2 + h 2 ,

recalling that the EL appears only if the value ϕ=π4is not included in the interval (ϕ1, ϕ2).

Notice now that the quantities ΔSWL and ΔSEL depend both on h and d We therefore propose the following graphical analysis. By recalling that the functions ΔSWL and ΔSEL are defined in the two-dimensional interval of the first quadrant of the hd-plane in which hR2-d22Rwe again fix R = 1000 In the case of ΔSEL, we need to exclude the additional portion of the hd-plane for which ϕ1>π4. Therefore, we may represent ΔSWL and ΔSEL 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 hand 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 ΔSWL and ΔSEL follow different patterns. In fact, while higher walls give, for not too small distances, higher value of ΔSWL, the same is not true for ΔSEL. 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 ΔSWL and ΔSEL. 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 ΔSWL, the value of ΔSWL (Fig. 4a) will remain in the darkest region. On the other hand, the value of ΔSEL (Fig. 4b) will always be rather high, being the graph in the light region for very small values of d.

Figure 4
Contour plot for ΔSWL (a) and ΔSEL (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.

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.

Figure 5
Contour plot for the total extension of safe territory ΔSWL + ΔSEL 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.

4. 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.

References

  • [1]
    F.W. Sears, M.W. Zemansky and H.D. Young, University Physics (Addison-Wesley, Reading, 1977), 5thed.
  • [2]
    D. Halliday, R. Resnick and J. Walker, Fundamentals of Physics (John Wiley & Sons, New York, 2005), 7thed.

Appendix

We here determine the expression for the security parabola. Starting from the trajectory equation, we write

(A-1) y θ x = - x 2 2 R tan 2 θ + x tan θ - x 2 2 R .

Let us now ask ourselves at which angle θ we can reach the point of generic abscissa x and ordinate y. Therefore, we set

(A-2) x 2 tan 2 θ - 2 R x tan θ + x 2 + 2 R y = 0 .

By solving the above second-order algebraic equation, we impose the condition on the discriminant

(A-3) Δ = 4 R 2 x 2 - 4 x 2 x 2 + 2 R y 0

In order to obtain the envelope, we set Δ = 0, so that

(A-4) R 2 = x 2 + 2 R y ,

from which the equation for the security parabola, represented in Fig. 1 as a dashed line, follows

(A-5)y=R2-x22R.

Publication Dates

  • Publication in this collection
    Sept 2015

History

  • Received
    17 Feb 2015
  • Accepted
    24 Apr 2015
Sociedade Brasileira de Física Caixa Postal 66328, 05389-970 São Paulo SP - Brazil - São Paulo - SP - Brazil
E-mail: marcio@sbfisica.org.br