MathGroup Archive 2006

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

Search the Archive

Re: distance function

  • To: mathgroup at
  • Subject: [mg68743] Re: distance function
  • From: "Ray Koopman" <koopman at>
  • Date: Fri, 18 Aug 2006 03:11:43 -0400 (EDT)
  • References: <ebujs5$6l2$>
  • Sender: owner-wri-mathgroup at

dimmechan at wrote:
> 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.

Outer[ Norm[Plus[##]]&, coordlist, -coordlist, 1]

where coordlist is an n x m array containing the
coordinates of n points in an m-dimensional space.

  • Prev by Date: Re: product formula in mathematica
  • Next by Date: RE: product formula in mathematica
  • Previous by thread: Re: distance function
  • Next by thread: Re: distance function