[HELP] Calculate the vehicle speed (km/h)
#1

Hello guys,

How I caltulate the vehicle speed as km/h?
Reply
#2

Formula:
√ ((X ^ 2) + (Y ^ 2) + (Z ^ 2))

Now just multiply with a value to become a correct speed.
Reply
#3

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
Formula:
√ ((X ^ 2) + (Y ^ 2) + (Z ^ 2))

Now just multiply with a value to become a correct speed.
LOL XDDDD Omg, Ryder!
Reply
#4

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
Formula:
√ ((X ^ 2) + (Y ^ 2) + (Z ^ 2))

Now just multiply with a value to become a correct speed.
1. "with a value" What kind of value?
2. What is this formula based on?
3. There are 3 values, wouldnt it be logical that there is a cube root instead of a square root? (might be solved with point 2 )

Sry but i am sort of curious, i dont wanna use smth without knowing the background (although i didnt start this topic )
Reply
#5

Should look something like this?
pawn Код:
floatsqroot(floatpower(floatabs(X), 2.0) + floatpower(floatabs(Y), 2.0) + floatpower(floatabs(Z), 2.0))
Reply
#6

pawn Код:
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 200.0); //100.0
[EDIT] crap thats mph lol sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)