Home > other >  What a great god help me get this rewrite the python
What a great god help me get this rewrite the python

Time:10-16

Public static ArrayList FilterFarMatchL (ArrayList Matches, double minX, double minY) {
Int arcStep=ModifiableConst. GetSolpeArcStep ();
If (matches. The size () & lt;=1) return matches;
Int [] ms=new int [90/arcStep];//array index save each degree of the key, do not use the map to save, performance optimization
For (Match m: matches) {
Double r=Math. Atan (m.k p2. GetY () + minY m.k p1, getY ())/(m.k p2. GetX () + minX m.k p1. GetX ())) * 360
/(2 * Math. PI);
Margaret spellings lopeArc=(int) r/arcStep * arcStep;//calculation for the first time sent the slope of the match saved,
If (Margaret spellings lopeArc & lt; Margaret spellings lopeArc + 0)=90;
Ms Margaret spellings lopeArc/arcStep=[ms Margaret spellings lopeArc/arcStep] + 1;
}
int count=0;
Int independence idx=0;
for (int i=0; i If (ms [I] & gt; The count) {
The count=[I] ms;
Independence idx=I;
}
}
Independence idx=independence idx * arcStep;
ArrayList Survivors=new ArrayList (a);
For (Match m: matches) {
If (Margaret spellings lopeArc==independence idx) survivors. The add (m);
}
Return the survivors;
}
  • Related