Question over added velocities.
I have a jetpack that boosts users in certain directions. I have a problem where I need to split up a certain speed and divide it distribute it between the X and Y axes according to the direction the user is facing.
The problem is: I don't know how powerful to make each individual value because vectors don't add together in a simple manner. Distributing a velocity of 300 on the X axis and 300 on the Y axis appears to be the exact same speed as distributing 400 on just the X axis. When I think about it more, could it possibly be working off of a right triangle? According to Pythagorean's theorem, 424.26 would be the same velocity on the X axis as 300 and 300 would be on both the X and the Y axes. If this is the case, what formula would I need to run my velocity through to distribute the velocities between X and Y so as not to exceed the 424.26 max velocity? Such as if I had 150 on the X, what would I need on the Y? It's not as clean as 300/300. Would that still be working off of the Pythagorean Theorem and I just need to find the hypotenuse for both the X and the Y according to 424.26 or something like that? |
Re: Question over added velocities.
I'll try to explain though i didn't get all what you said.
Your velocity vector: V{x, y} Speed: S == sqrt(x*x + y*y) Normalized velocity vector: N{x/S, y/S} So you can get a new velocity vector using another speed: V2{x*S2/S, y*S2/S} Let's assume that you have Speed and X, and want to find Y. Then: S*S == x*x + y*y y == sqrt(S*S - x*x) |
Re: Question over added velocities.
Cool! Thanks.
|
| All times are GMT -4. The time now is 22:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.