STNSOLIDTECHNEWS
Software-SaaS •

The Physics Powering Captain America’s Ricocheting Shield

By Enterprise Infrastructure Desk
12 min read
The Physics Powering Captain America’s Ricocheting Shield
Dev Stack & Cloud Developer & Infrastructure Toolkits: Streamline your tech stack with verified cloud hosting packages, API security suites, and developer SaaS deals.
Explore Tools ($149) →

1 of Captain America’s signature moves is throwing his shield and possessing it hit its concentrate on following multiple bounces. It is just what he does. But how hard would this in fact be? Yes, I know Captain The united states is just a comic ebook hero, but that doesn’t suggest this won’t be a enjoyment physics problem. How do you design a thrown shield reflecting off unique surfaces? Really, that’s the hard portion. Permit me go forward and get started with some assumptions.

The velocity of the shield doesn’t make any difference. I will assume it “flies” like an airplane wing so it will observe a degree trajectory and not drop as it travels. In the comic guides, the shield is manufactured from vibranium. Let’s assume this allows properly elastic collisions with unique surfaces. As I showed just before, a wholly elastic collision can obey the “law of reflection”. This signifies that when the shield hits a wall, the angle of incidence will be equivalent to the angle of reflection.

I consider that’s plenty of to get started generating a design. It is not hard to make a shield transfer at a continual velocity, but the reflection off a wall is not so straightforward. Here’s 3 thoughts you have to question:

Does the shield even hit the wall? When and where is the collision with the wall? What is the mirrored velocity vector given the orientation of the wall and the incoming velocity?

Yes, it would be fairly quick to design this in the situation of a wall that is only in the y-way (up/down), but I want a extra generic reflection. Initial, how do we know if there is a collision? There are many approaches for collision detection (it’s an essential portion of quite a few movie game titles) but I want to produce my individual. Suppose I have a wall with a length of L, oriented in some way, and a shield transferring towards it. The initially issue I am heading to do is to discover the place of the two stop points for the wall (P1 and P2). Now I can compute the distance from P1 and P2 to the place of the shield. If the shield is intersecting this wall, the sum of these distances need to equivalent L. Below is a diagram:

If I compute these distances as vectors, the sum of the magnitudes of r1 and r2 (from P1 and P2 to the shield) will only equivalent L if the center of the shield is between the two points. If the shield is outside the points or not nevertheless to the wall, their sum will exceed L. A couple of points to observe. Initial, I am just working with this wall in 2-D, but this strategy need to operate in 3-D. 2nd, I really don’t treatment about the sizing of the shield—I am merely dealing with it as a place object. I really don’t consider this matters for taking part in with collisions with a wall (we could alter this later if it bothers you). Now for the reflection. This is trickier and my strategy only operates in 2-D so the shield moves in the x-y plane. If I produce a wall in VPython (Glowscript), there are some houses of this object which is technically a “box.” There is the place of the center of the box, the sizing of the box and the “axis.” The axis is a vector that is perpendicular to the box to describe its orientation. Below is a diagram exhibiting the shield colliding with the wall. The two essential vectors are the velocity and the axis.

Below I have α as the angle between the incident velocity vector and the axis vector. You can discover this angle by initially obtaining the dot product between these two vectors and utilizing the subsequent connection:

Acquiring the dot product for vectors is uncomplicated if you know the vector in component variety (the x,y,z elements). It is also uncomplicated to discover the magnitude of these vectors. So, in the stop you get the angle between these two vectors. Oh, it’s even much easier considering the fact that equally the dot product (dot) and the vector magnitude (mag) are created in functions in VPython. But what I genuinely need is the angle θ which demonstrates the volume I would have to rotate the initial vector. Based mostly on my drawing, this vector θ would be:

Now that I have the rotation angle, I need to rotate the vector. I can use the rotation matrix in 2-D. Below is the xkcd model of the rotation matrix. It is funnier than the genuine matrix. So, that’s very uncomplicated. Now let’s place it all jointly. Essentially, this is form of like a movie sport. So I manufactured a movie sport. Just drag the arrow to decide on the way you desire to aim the shield. The target is to bounce the shield off the wall and hit the blue circle. If you efficiently hit the circle, it turns yellow. If you skip, just press engage in and attempt once more. The code is a little messy—but you can examine it out here. I’ll almost certainly make a screencast in which I go over the unique areas of this software. When you engage in with this software, you might observe it’s not so trivial to aim at the wall and hit the concentrate on. You can do it, but only with a little bit of guesswork. How about some thing a bit more complicated? What if the mirrored area is not a flat wall but a curved area? In this situation we can nonetheless assume that the incident and mirrored angle are nonetheless equivalent. On the other hand, there is a major variance. Now if you hit the curved area at a somewhat unique place, it will have a unique axis about which it will replicate.

In conditions of coding, it’s in fact an much easier software to produce. Collision detection is less complicated. All I need to do is identify the distance from the center of the curved wall to the center of the shield. If this distance is fewer than the sum of their radii, then they “hit.” Just after that, I merely need to compute the vector that is equal to the axis vector for the wall. There is just one problem that I encountered—depending on where the shield hits, it could replicate either to the remaining or the right. By obtaining the angle between the incident velocity vector and the “axis” I can identify the way of rotation in the rotation matrix. Below is the identical “game” with a curved area. (the code) Very hard, right? Of study course Captain The united states is improved than all of you at this. He can bounce his shield off multiple surfaces and rating a “hit.” Are you ready to attempt two bounces? Test to hit the curved area and then the wall and then concentrate on. Below is the code. If you rating a hit on your initially attempt, you need to be an Avenger. And if you want some research, here are a couple ideas.

Make a plot of first velocity angle vs. deflected angle. How does this plot glimpse for equally the flat and curved wall? You might choose to make a plot of first angle vs. closing y-place or some thing. What if you place in a third object to deflect the shield? Is it even solvable? Can you make the personal computer software discover an angle that would rating a hit? What about non-elastic collisions? Yes, that would be a little bit extra difficult—but nonetheless enjoyment.

Go Again to Leading. Skip To: Get started of Report.

Supply backlink Share this:Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window)Click to share on Google+ (Opens in new window)

Related

1 of Captain America’s signature moves is throwing his shield and possessing it hit its concentrate on following multiple bounces. It is just what he does. But how hard would this in fact be? Yes, I know Captain The united states is just a comic ebook hero, but that doesn’t suggest this won’t be a enjoyment physics problem.

How do you design a thrown shield reflecting off unique surfaces? Really, that’s the hard portion. Permit me go forward and get started with some assumptions.

I consider that’s plenty of to get started generating a design. It is not hard to make a shield transfer at a continual velocity, but the reflection off a wall is not so straightforward. Here’s 3 thoughts you have to question:

Yes, it would be fairly quick to design this in the situation of a wall that is only in the y-way (up/down), but I want a extra generic reflection. Initial, how do we know if there is a collision? There are many approaches for collision detection (it’s an essential portion of quite a few movie game titles) but I want to produce my individual.

Suppose I have a wall with a length of L, oriented in some way, and a shield transferring towards it. The initially issue I am heading to do is to discover the place of the two stop points for the wall (P1 and P2). Now I can compute the distance from P1 and P2 to the place of the shield. If the shield is intersecting this wall, the sum of these distances need to equivalent L. Below is a diagram:

If I compute these distances as vectors, the sum of the magnitudes of r1 and r2 (from P1 and P2 to the shield) will only equivalent L if the center of the shield is between the two points. If the shield is outside the points or not nevertheless to the wall, their sum will exceed L.

A couple of points to observe. Initial, I am just working with this wall in 2-D, but this strategy need to operate in 3-D. 2nd, I really don’t treatment about the sizing of the shield—I am merely dealing with it as a place object. I really don’t consider this matters for taking part in with collisions with a wall (we could alter this later if it bothers you).

Now for the reflection. This is trickier and my strategy only operates in 2-D so the shield moves in the x-y plane. If I produce a wall in VPython (Glowscript), there are some houses of this object which is technically a “box.” There is the place of the center of the box, the sizing of the box and the “axis.” The axis is a vector that is perpendicular to the box to describe its orientation.

Below is a diagram exhibiting the shield colliding with the wall. The two essential vectors are the velocity and the axis.

Below I have α as the angle between the incident velocity vector and the axis vector. You can discover this angle by initially obtaining the dot product between these two vectors and utilizing the subsequent connection:

Acquiring the dot product for vectors is uncomplicated if you know the vector in component variety (the x,y,z elements). It is also uncomplicated to discover the magnitude of these vectors. So, in the stop you get the angle between these two vectors. Oh, it’s even much easier considering the fact that equally the dot product (dot) and the vector magnitude (mag) are created in functions in VPython. But what I genuinely need is the angle θ which demonstrates the volume I would have to rotate the initial vector. Based mostly on my drawing, this vector θ would be:

Now that I have the rotation angle, I need to rotate the vector. I can use the rotation matrix in 2-D. Below is the xkcd model of the rotation matrix. It is funnier than the genuine matrix. So, that’s very uncomplicated. Now let’s place it all jointly.

Essentially, this is form of like a movie sport. So I manufactured a movie sport. Just drag the arrow to decide on the way you desire to aim the shield. The target is to bounce the shield off the wall and hit the blue circle.

If you efficiently hit the circle, it turns yellow. If you skip, just press engage in and attempt once more. The code is a little messy—but you can examine it out here. I’ll almost certainly make a screencast in which I go over the unique areas of this software.

When you engage in with this software, you might observe it’s not so trivial to aim at the wall and hit the concentrate on. You can do it, but only with a little bit of guesswork.

How about some thing a bit more complicated? What if the mirrored area is not a flat wall but a curved area? In this situation we can nonetheless assume that the incident and mirrored angle are nonetheless equivalent. On the other hand, there is a major variance. Now if you hit the curved area at a somewhat unique place, it will have a unique axis about which it will replicate.

In conditions of coding, it’s in fact an much easier software to produce. Collision detection is less complicated. All I need to do is identify the distance from the center of the curved wall to the center of the shield. If this distance is fewer than the sum of their radii, then they “hit.” Just after that, I merely need to compute the vector that is equal to the axis vector for the wall. There is just one problem that I encountered—depending on where the shield hits, it could replicate either to the remaining or the right. By obtaining the angle between the incident velocity vector and the “axis” I can identify the way of rotation in the rotation matrix.

Below is the identical “game” with a curved area. (the code)

Of study course Captain The united states is improved than all of you at this. He can bounce his shield off multiple surfaces and rating a “hit.” Are you ready to attempt two bounces? Test to hit the curved area and then the wall and then concentrate on. Below is the code.

If you rating a hit on your initially attempt, you need to be an Avenger. And if you want some research, here are a couple ideas.

Go Again to Leading. Skip To: Get started of Report.

Share this report:
Facebook Post Share