#Calculate and display speed (kph)
1 messages · Page 1 of 1 (latest)
Looking from a brevity perspective, yes multiplied by 3.6 (60*60/1000) is better. But if I look at Josh Garrett's code in 5 months, I will immediately understand what the code does, but if it is just 3.6 - I will have to spend a few extra milliseconds or seconds/minutes to understand what it means 🙂
Haha thanks Alan, I was never very good at math, someone said velocity/1000 x 60 (minutes) x 60 (hours), so multiply the magnitude by 3.6? or the magnitude divided by 1000?
Will give some tests, thanks again
magnitude x 3.6
*ahem* 🤓
Since there is no complier in VS that will optimize the arithmetic together, and the cost of executing a single node is much higher than regular c# reducing the amount of nodes like this can be pretty important.
In this case, where it's happening once~ per frame it's not a big deal.