Questions tagged [distance]

89 questions
5
votes
2 answers

Distance between a point and a curve

I have the general equation of an elipse and a point P0: elipse=0.31368-0.113863x-0.00127066x^2+0.00329003y+0.000817666xy+0.0000929297y^2 P0={-6.4,172.0} I would like to find the point on the curve which has the shortest distance from P0. What…
Jane
  • 51
  • 1
4
votes
1 answer

Why does MMA force a DistanceFunctions to be positive?

Consider the following piece of code: DistanceMatrix[Range[10], DistanceFunction -> Function[{x, y}, x - y]] I would have expected it to return a skew-symmetric matrix, but it seems that MMA forces my custom distance function to return positive…
ITA
  • 393
  • 1
  • 8
0
votes
0 answers

How to find the distance from this point to a straight line?

Clear["Global`*"] reg = ImplicitRegion[ x + k y == 0, {x, y}] pt = {-((a^2 k)/Sqrt[b^2 + a^2 k^2]), b^2/Sqrt[b^2 + a^2 k^2]} RegionDistance[reg, pt] Why is it impossible to find the distance from this point to the straight line? The known condition…
csn899
  • 3,953
  • 6
  • 13
0
votes
0 answers

The smallest (and biggest) distance of points from the function

please give me an advice. I have points ("data", x and y coordinates). For these points, I created a residual function function = LinearModelFit [dat, x, x] Now I have to determine the point that has the smallest and largest distance from this line.…
Thera
  • 41
  • 2