This is what I use for distances between conductors of a power line.
Self distances will be 0 but if needed they can be added (in my case
these would be conductor diameters)
'n,n array of distances between conductors '
' result =. dij (conductor positions as complex numbers )
dij=: |@ -/~
hope this is helpful
Don Kelly
On 2021-02-16 1:37 a.m., 'Michael Day' via Programming wrote:
In connection with the recent correspondence on the PAM algorithm for
k-medoids,
I thought it _might_ be worth considering using complex coordinates,
eg
cdata =: j./"1 data
so that distance between points is just the magnitude of the
difference of their complex
representations.
Forgetting that magnitude was simply | , I found an apparent mistake
in the NuVoc:
this appears near the bottom of
*https://code.jsoftware.com/wiki/Vocabulary/jdot#dyadic :**
**
*
*Related primitives**
**Real/Imag (+. y), Signum (Unit Circle) (* y), Length/Angle (*. y),
Magnitude (* y), .....**
*
*
**Clearly, it should read " .... Magnitude (| y), ..."**
*
I've just seen there's a page for reporting issues, but I don't think
I have an account and
don't intend to make a habit of spotting errors there, so I hope this
is ok!
Cheers,
Mike
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm