How do I Get total/resultant velocity?

Get help using Construct 2

Post » Sat Feb 25, 2017 10:41 am

The Physics behavior has these expressions: "VelocityX" and "VelocityY", and it has a condition for "Compare (total) velocity". However, I can't see a way to get the value for "total velocity" itself .

I've looked up the formula online but can't wrap my head around it. They seem to be teaching how to get Vx and Vy, given the total/resultant velocity and angle while in C2, it's the other way around, i.e. the Vx and Vy are known and the total/resultant velocity (while seemingly known since there's a condition for it) is not accessible to the user.

I need to know how to get total/resultant velocity given Vx and Vy. Thanks in advance!
B
13
S
3
Posts: 17
Reputation: 984

Post » Sat Feb 25, 2017 11:33 pm

High school math class: the hypotenuse is equal to the square root of the sum of the squares of the two opposite sides. Speed being a direct derivative of distance, we can surmise that the same is true for speed also. Therefore:

Speed = sqrt( ( VelocityX^2 ) + ( VelocityY^2 ) )

[ Edit: in honesty I had to Google this, but did so by Googling 'converting two vectors to velocity' - which is as embarrassing for me as it should be for you :P ]
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 242
Reputation: 2,306

Post » Sun Feb 26, 2017 12:22 am

mrtumbles wrote:High school math class: the hypotenuse is equal to the square root of the sum of the squares of the two opposite sides. Speed being a direct derivative of distance, we can surmise that the same is true for speed also. Therefore:

Speed = sqrt( ( VelocityX^2 ) + ( VelocityY^2 ) )

[ Edit: in honesty I had to Google this, but did so by Googling 'converting two vectors to velocity' - which is as embarrassing for me as it should be for you :P ]


Yeah I am glad you added that edit as I knew there was a formula I learned in engineering but no way I could pull that out and drop it without looking it up first lol!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » Sun Feb 26, 2017 5:52 am

You can also use the distance expression, after all it's the same equation.
distance(0,0,velocityX,velocityY)
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Mon Feb 27, 2017 6:42 am

Thanks! Yes, it's embarrasing :D The distance thing is very helpful as well!
B
13
S
3
Posts: 17
Reputation: 984


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 18 guests