03-06-2023, 07:29 PM
(03-06-2023, 06:18 PM)bplus Wrote: FYI QB64 has _Hypot(x, y) function!
https://qb64phoenix.com/qb64wiki/index.php/HYPOT
For 2 points (x1, y1) and (x2, y2)
dist = _Hypot(x1 - x2, y1, y2)
I didn't know that either. I imagine there are loads of utility functions added since the original BASIC that I should be using. In this instance it's surely quicker to stick with x.x + y.y and no square root or hypot function at all. Nice to see a less lazy version than my quick one though! I didn't realise this technique actually had a name!
RokCoder - dabbling in QB64pe for fun