For the mid-point of any two points - which is the nearest equidistant point: pts=. 1 2,:3 0 mean pts 2 1 dis=. 4 : '%:+/*:x-y'"1 pts dis mean pts 1.4142136 1.4142136
For three points in a plane there is no solution if they are co-linear but if they are a triangle, the intersection of perpendicular bisectors is the equidistant point - see http://jwilson.coe.uga.edu/EMT668/EMAT6680.2003.Su/Messig/assignment4/trianglearecyclic.html. See "xyrf3P" at http://www.jsoftware.com/jwiki/Phrases/Geometry#Circlethrough3points for a function for this, e.g. ]rndtri=. ?3 2$10 NB. Random triangle 5 5 5 3 8 0 edp=. 2{.xyrf3P rndtri NB. Equidistant point NB. Graph the three points in green, the equidistant point in blue and draw red lines to show NB. the distances. pd 'reset' pd 'type line;pensize 2;color RED' pd ,&.>(<"1 |:rndtri),.&.>edp pd 'type point;pensize 5;color BLUE' pd <"1 edp,.edp pd 'type point;pensize 4;color GREEN' pd <"1 |:rndtri pd 'show' For more than three points, I think there's only a solution if the points are on a circle. On Fri, Oct 30, 2009 at 5:21 AM, Richard Donovan <[email protected]>wrote: > > Point equidistant to 3 or more other points > > Hi! > > > Not specifically related to J, a maths question really, but I will try to > code the solution in J! > > > If there are 2 points, (x1 y1) and (x2 y2), the equidistant point is at the > midpoint at location ((x1+x2)/2) ((y1+y2)/2) > > > eg if there are 2 points p and q at locations (1,2) and (3,0) the point > equidistant is at (2,1) - the midpoint m > > > y > > 4 | > > 3 | > > 2 |p > > 1 | m > > _ |__q_______ x > > 0 1 2 3 4 > > > Suppose there are more than 2 points? Is there a formula for working out > the point equidistant to the n points? > > > eg if there are 3 points p q r at locations (1,2) (3,0) and (3,2), the > point equidistant is still at (2,1), but I can't see a way of computing > this from the figures. > > > y > > 4 | > > 3 | > > 2 |p--r > > 1 | m > > _ |__q_______ x > > 0 1 2 3 4 NB hyphens are spaces-hotmail changes 2 spaces > to 1 > > > This is not a test question or homework crib - I am just interested in > mathematics! > > > The thought occured to me and I just cant see a solution for the > general case finding equidistant point of points (x1 y1) (x2 y2) (x3 y3) > ... > (xn yn) > > ...and as for the 3D case (x1 y1 z1) (x2 y2 z2) (x3 y3 z3) ... > (xn yn zn)......!!!!!! > > > Thanks in advance! > > > > > > > _________________________________________________________________ > New Windows 7: Simplify what you do everyday. Find the right PC for you. > http://www.microsoft.com/uk/windows/buy/ > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
