MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

distance function

In the book of Gaylord et al. (1996) there is one exercise which asks
(see page 113)

"Given a list of points in the plane, write a function that finds the
set of all distances
between the points."

Although there is one solution, that solution makes use of the Table
and Length commands.

Is it a way to define the same function using Higher-Order functions
like Outer, MapThread etc?

Thanks in advance for any help.

  • Prev by Date: position lists
  • Next by Date: Product over an arbitrary index.
  • Previous by thread: Re: position lists
  • Next by thread: Re: distance function