擅长:python、mysql、java
<p>我想我应该这样做:</p>
<pre><code>angles = [get_angle_from_xaxis(origin,point) for point in points]
#make sure the angles are in order
angles.sort()
#need to compare last one with first one
angles.insert(0,angles[-1]-360.0) #360 if degrees, otherwise 2*math.pi.
#Now calculate the difference between adjacent angles and take the maximum
maxangle = max( angles[i] - angle for i,angle in enumerate(angles[:-1],1) )
</code></pre>
<p>这基本上就是你描述的解决方案。我只添加了最后一个和第一个之间的检查,以确保角度顺序正确。在</p>