예제 #1
0
        public static void Test(AUTD autd)
        {
            const double x = AUTD.DeviceWidth / 2;
            const double y = AUTD.DeviceHeight / 2;
            const double z = 150;

            autd.SilentMode = false;

            var mod = Modulation.Static();

            autd.Send(mod);

            var       center   = new Vector3d(x, y, z);
            var       seq      = PointSequence.Create();
            const int pointNum = 200;

            for (var i = 0; i < pointNum; i++)
            {
                const double radius = 30.0;
                var          theta  = 2.0 * Math.PI * i / pointNum;
                var          p      = radius * new Vector3d(Math.Cos(theta), Math.Sin(theta), 0);
                seq.AddPoint(center + p);
            }
            seq.Frequency = 1;
            Console.WriteLine($"Actual frequency is {seq.Frequency}");
            autd.Send(seq, mod);
        }
예제 #2
0
        public static void Test(AUTD autd)
        {
            const double x = AUTD.DeviceWidth / 2;
            const double y = AUTD.DeviceHeight / 2;
            const double z = 150.0;

            autd.SilentMode = false;

            var mod = Modulation.Static();

            autd.Send(mod);

            const double radius = 30.0;
            const int    size   = 100;
            var          center = new Vector3d(x, y, z);
            var          stm    = autd.STM();

            for (var i = 0; i < size; i++)
            {
                var theta = 2 * AUTD.Pi * i / size;
                var r     = new Vector3d(Math.Cos(theta), Math.Sin(theta), 0);
                var f     = Gain.FocalPoint(center + radius * r);
                stm.AddSTMGain(f);
            }
            stm.StartSTM(0.5);

            Console.WriteLine("press any key to stop...");
            Console.ReadKey(true);

            stm.StopSTM();
            stm.FinishSTM();
        }