コード例 #1
0
        private List <Emiter> GenerateEmiters(double alfa, int radius, int maxX, int maxY, Point centerOfCircle)
        {
            List <Emiter> generatedEmiters = new List <Emiter>();

            for (double i = 0; i < 360; i += alfa)
            {
                double angleInRadians = CircleUtil.DegreesToRadians(i);
                Point  newEmiterPoint = CircleUtil.GeneratePointOnArc(centerOfCircle, radius, angleInRadians);
                generatedEmiters.Add(new Emiter(newEmiterPoint, angleInRadians));
            }

            return(generatedEmiters);
        }
コード例 #2
0
        private List <Detector> GenerateDetectors(int amountOfDetectors, double angularSpread, Emiter emiter, int radius, Point centerOfTheCircle)
        {
            List <Detector> detectors = new List <Detector>();
            double          angle     = emiter.Angle + Math.PI - CircleUtil.DegreesToRadians(angularSpread) / 2;
            double          step      = CircleUtil.DegreesToRadians(angularSpread / amountOfDetectors);

            for (int i = 0; i < amountOfDetectors; i++)
            {
                Point pointOfDetector = CircleUtil.GeneratePointOnArc(centerOfTheCircle, radius, angle);
                detectors.Add(new Detector(pointOfDetector));
                angle += step;
            }

            return(detectors);
        }