Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
closestPair(v)={
|
||||
my(r=norml2(v[1]-v[2]),at=[1,2]);
|
||||
for(a=1,#v-1,
|
||||
for(b=a+1,#v,
|
||||
if(norml2(v[a]-v[b])<r,
|
||||
at=[a,b];
|
||||
r=norml2(v[a]-v[b])
|
||||
)
|
||||
)
|
||||
);
|
||||
[v[at[1]],v[at[2]]]
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue