0
点赞
收藏
分享

微信扫一扫

5G 技术对物联网(IoT)有哪些具体影响?

迎月兮 2024-10-15 阅读 20

题目:

题解:

class Solution {
private:
    mt19937 gen{random_device{}()};
    uniform_real_distribution<double> dis;
    double xc, yc, r;

public:
    Solution(double radius, double x_center, double y_center): dis(0, 1), xc(x_center), yc(y_center), r(radius) {}
    
    vector<double> randPoint() {
        double u = dis(gen), theta = dis(gen) * 2 * acos(-1.0);
        double r = sqrt(u);
        return {xc + r * cos(theta) * this->r, yc + r * sin(theta) * this->r};
    }
};
举报

相关推荐

0 条评论