f****n 发帖数: 4615 | 1 ☆─────────────────────────────────────☆
willhung (黄威廉) 于 (Fri May 26 19:48:09 2006) 提到:
Q1: 在一个圆上随意选取三个点,三个点在同一半圆上的概率
public static double circle_1(){
final int k = 100000;
int count = 0;
double pts[]= new double[3];
Random r = new Random();
for(int j=0;j
pts[0] = r.nextDouble()*360;
pts[1] = r.nextDouble()*360;
pts[2] = r.nextDouble()*360;
Arrays.sort(pts);
count += (Math.max(Math.max(pts[2]-pts[1], 360 + pts[0]-pts[2]),
|
|