Page MenuHomeFeedback Tracker

Please provide "distanceASL" as an alternative
Closed, ResolvedPublic

Description

As distance command takes relative positioning, it is not possible to quickly calculate distance between 2 absolute points. There is also no dedicated command to do so either.

distanceASL would expected to take 2 arrays: [posASL] distanceASL [posASL]
and return euclidean distance between them. Because of very simple nature it is expected to be extremely fast.

I don't think it is necessary to slow it down and complicate it by making it to accept objects as well, since normal distance command can do this already.

Thank you.

Details

Legacy ID
689391375
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Feature Request

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Feature Request.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Fixed.
Killzone_Kid set Legacy ID to 689391375.May 7 2016, 5:57 PM

Even though there's no priority for this request, Dwarden still cares about it and kk's analysis deepened my knowledge anyway :)

Simon added a comment.May 30 2014, 1:50 PM

@Killzone_Kid: we are currently adding some generic arithmetic operations for 3D vectors. Will

vectorDistance [ pos1, pos2 ]

be okay? ( ie different notation and name, same functionality).

Absolutely, thank you very much!

I did some testing "distance" vs "vectorDistance". To my huge surprise, given fixed positions to both, distance - a pretty complicated function is faster than vectorDistance, which is supposed to be a simple euclidean computation. The whole idea behind distanceASL was for a superfast function. Kinda disappointed at the mo.

Simon added a comment.Jun 4 2014, 10:27 AM

Can I have the test (a script, I presume) ?

Hi, Simon. It is bis_fnc_codeperformance script.

Hey Simon, thanks a lot for changing the syntax of vector commands, now vectorDistance is as fast as distance, so all good!

This ticket could be closed

Dear Simon,

Thanks again for the addition and optimisation of these essential and versatile vector commands. As I've been using them more and more I think there is one more thing that could be added to make them even better.

It is not always that you need to operate in 3d space and making these commands 2d compatible would make them complete. What's more it should not require much work on your part either.

I'm talking about defaulting the 3rd vector param to 0 when no 3rd vector param is specified

so

vectorCommand (x, y, z)

will become

vectorCommand (x, y, z = 0)

Really appreciate your work and looking forward to this change!

clean up. better solution found and it works.