Math - Scalar Multiplication

I got (40, -50)

They way I did it was just figure out how many units was per second which was given in the question.

If the player moves SOUTH at 5 units per second then in 10 seconds it will be at -50.

If the player moves EAST at 2 units per second then in 20 seconds it will be at 40.

The player will end up at (40, -50)

  1. The player starts at (0, 0)
  2. The player moves south (0, -1) at 5 units/second for 10 seconds
  3. The player moves east (1, 0) at 2 units/second for 20 seconds
  4. Where did they end up?

( 0 +1*(2 * 20), 0 - 1*(5 * 10) ) = ( 40, -50 )

Player starts at origin (0,0), then moves in the direction south (0,-1) by 5 units/s for 10 seconds (510(0,-1)=(0,-50)) to arrive at (0,-50). Next the player moves east (1,0) at 2 units per second for 20 seconds (220(1,0)=(40,0)) to arrive at (0,-50)+(40,0)=(40,-50).

the character would have moved to point 40, -50 on the scale

1.) Start at 0,0

2.) South (0,-1) for 10 seconds at 5 units/second

  • Vector = (0,-1)
  • Scalar = (10s * 5u/s) = 50 units
  • Vector * Scalar = (0,-50) = south movement vector

3.) East (1,0) for 20 seconds at 2 units/second

  • Vector = (1,0)
  • Scalar = (20s * 2u/s) = 40 units
  • Vector * Scalar = (40,0) = east movement vector

4.) (0,-50) + (40,0) = (40,-50) = new player position

  1. (0,0)
  2. Moving south → (0,0) + 10*(0,-5) → (0,-50)
  3. Moving east → (0,-50) + 20*(2,0) → (40,-50)
    Player ends up on (40,-50)

Converted this lecture into real-time example :smiling_face_with_three_hearts:

rathodketan

Player starts at = (0, 0)
After 10 seconds player will be at = (0, -50)
After 20 second player will be at = (40, -50)
Player end at = (40, -50)

I wasn’t sure how to implement the course material to this particular problem. So, I just approached it using a logical approach. Hope this works!

Start Location: (0,0)

x = 0;
y = 0;

y = (-5) * 10 = (-50);
x = 2 * 20 = 40;

New Location: (40, -50)

Here’s my work for the player movement challenge:

Let OS be our starting vector (0, 0)
Let V1 be the vector following our first move
Let V2 be the vector following our second move

V1 = OS + (-1 * (0, 5 * 10))
V1 = OS + (-1 * (0, 50))
V1 = OS + (0, -50)
V1 = (0 + 0, 0 + -50)
V1 = (0, -50)

In this first equation, I’m equating ‘moving South’ with moving into the negative range of the y-axis, so we use the -1 as a scalar to invert the vector (otherwise you end up with positive movement up the y-axis).

Now that our player has moved to their new position (0, -50) we can follow the next movement:

V2 = V1 + (2 * 20, 0)
V2 = V1 + (40, 0)
V2 = (0 + 40, -50 + 0)
V2 = (40, -50)

For this final step, I interpreted ‘moving East’ as moving into the positive values of the x-axis. Because we’re not moving backward, and apparently not increasing our speed, we don’t need any extra scalar manipulation and can just work the equation as we expect. This ultimately leaves us with a position of (40, -50) for the player.

1 Like

Privacy & Terms