jeudi 31 janvier 2019

How to use a random number from the weibull distribution?

i am trying to place weibull distributed random numbers in a sector of a circle.

i generated the random number then distributed it in weibull distribution. now i want to use these weibull distributed random numbers.

RadarSpace GetWeibullClutter()
            { 
                Random _randomNumberGenerator = new Random();
                Weibull myweibull = new Weibull(3,2,_randomNumberGenerator);

                int n = 50; // number of clutter elements
                var maxRange = _detectionModel.MaximumRange;
                var centreX = 0; // Centre of the field of view -- X coordinates
                var centreY = 0; // Centre of the field of view -- Y coordinates

                var minimumAngle = Math.PI / 4; // _detectionModel.MinimumPhi;
                var maximumAngle = (3 * Math.PI) / 4; // _detectionModel.MaximumPhir;

                var time = (maximumAngle - minimumAngle) * myweibull + minimumAngle;
                var r = maxRange * Math.Sqrt(_randomNumberGenerator.Next(n));

                var x = centreX + r * Math.Cos(time);
                var y = centreY + r * Math.Sin(time);

i want the weibull distributed random number to be multiplied in the var time but it rather says operator '*' cannot be applied to opperands of type 'double' and 'weibull'




Aucun commentaire:

Enregistrer un commentaire