kirennia
Part of the furniture
- Joined
- Dec 26, 2003
- Messages
- 3,857
edit:If you can think of any improvement to the questions, wording, versatility or whatever, please say so,
thanks.
Right...I've got no idea if this is easy or hard, what level it is etc, I just know it's beyond me today; working with vectors and matrix multiplications has sploded my brain! So here it is. None of the specific numbers are known prior to use so I'm looking for generic equations to solve the three following problems. Fear not, this isn't a homework cheat or anything, they're my questions which I can't even answer.../sigh. If wanted I'll post the resulting code for anyone who wants it
:
Variables in their simplest form:
Current point.
Destination point.
Total Time of the journey.
Current Time of the journey.
Elapsed time since the last tick.
Worthy of note is that the current and destination points, as well as the total time of the journey may change at any point during cycling of the used equation. Once in transition, the object will be unaware of its source point of origin so use of this variable is not allowed. The equations calculated must be shown as an amendment of the previous test and as such, tests may be taken at any specific non-integer based unit of time elapsed, throughout the objects journey. Unit descriptors are insignificant.
1)Determine an accurate equation for use which will allow the object to travel from a source point to its destination in a linear fashion.
2)Determine an accurate equation for use which will allow for the object to travel and arrive at its destination as if under deceleration in an exponential fashion, using the equation of x squared.
3)Use the above equation to calculate deceleration with an unknown exponent.
1)My gut instinct was to try:
Amend position by : (Destination - Source) / (Total time - Current time).
The problem comes with time remaining being measured at irregular points. I'll demonstrate the problem.
___Distance remaining_____Time remaining___
_________20__________________5_________
_________16__________________4_________
_________12__________________3_________
__________8__________________2_________
__________4__________________1_________
__________0__________________0_________
So you apply the formula to the first instance which is a simple 20/5 = 4 and thus amend the position by 4. If the next tick is at 1 second in, you can take 16, divide it by 4 and the formula still works. If however the next tick is at any other time, it simply falls apart as it hasn't taken into consideration the amount of time elapsed since the last test.
So the answer is:
Amend position by : ((Destination - Source) / (Total time - Current time)) * elapsedTime.
2) Here is where I'm stuck. If the source point was always zero, it wouldn't be so much of a problem but it's not. Any ideas anyone? Thanks in advance, have fun!![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Right...I've got no idea if this is easy or hard, what level it is etc, I just know it's beyond me today; working with vectors and matrix multiplications has sploded my brain! So here it is. None of the specific numbers are known prior to use so I'm looking for generic equations to solve the three following problems. Fear not, this isn't a homework cheat or anything, they're my questions which I can't even answer.../sigh. If wanted I'll post the resulting code for anyone who wants it
Variables in their simplest form:
Current point.
Destination point.
Total Time of the journey.
Current Time of the journey.
Elapsed time since the last tick.
Worthy of note is that the current and destination points, as well as the total time of the journey may change at any point during cycling of the used equation. Once in transition, the object will be unaware of its source point of origin so use of this variable is not allowed. The equations calculated must be shown as an amendment of the previous test and as such, tests may be taken at any specific non-integer based unit of time elapsed, throughout the objects journey. Unit descriptors are insignificant.
1)Determine an accurate equation for use which will allow the object to travel from a source point to its destination in a linear fashion.
2)Determine an accurate equation for use which will allow for the object to travel and arrive at its destination as if under deceleration in an exponential fashion, using the equation of x squared.
3)Use the above equation to calculate deceleration with an unknown exponent.
1)My gut instinct was to try:
Amend position by : (Destination - Source) / (Total time - Current time).
The problem comes with time remaining being measured at irregular points. I'll demonstrate the problem.
___Distance remaining_____Time remaining___
_________20__________________5_________
_________16__________________4_________
_________12__________________3_________
__________8__________________2_________
__________4__________________1_________
__________0__________________0_________
So you apply the formula to the first instance which is a simple 20/5 = 4 and thus amend the position by 4. If the next tick is at 1 second in, you can take 16, divide it by 4 and the formula still works. If however the next tick is at any other time, it simply falls apart as it hasn't taken into consideration the amount of time elapsed since the last test.
So the answer is:
Amend position by : ((Destination - Source) / (Total time - Current time)) * elapsedTime.
2) Here is where I'm stuck. If the source point was always zero, it wouldn't be so much of a problem but it's not. Any ideas anyone? Thanks in advance, have fun!