当前位置: 首页>>代码示例>>C#>>正文


C# Scene.Sound_speed方法代码示例

本文整理汇总了C#中Scene.Sound_speed方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Sound_speed方法的具体用法?C# Scene.Sound_speed怎么用?C# Scene.Sound_speed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scene的用法示例。


在下文中一共展示了Scene.Sound_speed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Direct_Sound

 /// <summary>
 /// Direct sound constructor. This prepares the simulation to run. 
 /// </summary>
 /// <param name="Src_in">The sound source</param>
 /// <param name="Rec_in">The collection of receivers</param>
 /// <param name="Room_in">The acoustical scene to render</param>
 /// <param name="RayCount">The number of rays which will be used </param>
 public Direct_Sound(Source Src_in, Receiver_Bank Rec_in, Scene Room_in, int[] Octaves)
 {
     type = Src_in.Type();
     Validity = new bool[Rec_in.Count];//[Rec_in.Count];
     Io = new double[Rec_in.Count][][];//[Rec_in.Count][t,8];
     Time_Pt = new double[Rec_in.Count];//[Rec_in.Count];
     Dir_Rec_Pos = new float[Rec_in.Count][][][];
     Dir_Rec_Neg = new float[Rec_in.Count][][][];
     Room = Room_in;
     C_Sound = Room_in.Sound_speed(0);
     SampleFreq = Rec_in.SampleRate;
     Src = Src_in;
     this.CO_Time = Rec_in.CO_Time;
     Receiver = new List<Point>();
     Rho_C = new double[Rec_in.Count];
     for(int i = 0; i < Rec_in.Count; i++)
     {
         Rho_C[i] = Room.Rho_C(Rec_in.H_Origin(i));
         Receiver.Add(Rec_in.H_Origin(i));
     }
     SWL = new double[8] { Src_in.SWL(0), Src_in.SWL(1), Src_in.SWL(2), Src_in.SWL(3), Src_in.SWL(4), Src_in.SWL(5), Src_in.SWL(6), Src_in.SWL(7) };
     Delay_ms = Src.Delay;
     Oct_choice = Octaves;
 }
开发者ID:philrob22,项目名称:PachydermAcoustic_Rhinoceros,代码行数:31,代码来源:Classes_Direct.cs

示例2: Receiver_Bank

            /// <summary>
            /// Receiver bank constructor.
            /// </summary>
            /// <param name="Pt">array of receiver origin points</param>
            /// <param name="SrcPT">sound source point</param>
            /// <param name="Room">the acoustical scene</param>
            /// <param name="RCT">the number or rays emanating from the source</param>
            /// <param name="CSound">the speed of sound in m/s</param>
            /// <param name="SampleRate_in">the simulation histogram sampling frequency</param>
            /// <param name="COTime_in">the Cut Off Time in ms.</param>
            /// <param name="Type">the type of receivers contained in this receiver bank</param>
            public Receiver_Bank(IEnumerable<Point3d> Pt, Point3d SrcPT, Scene Sc, int SampleRate_in, double COTime_in, double delayinms, Type Type)
            {
                delay_ms = delayinms;
                SampleRate = SampleRate_in;
                SampleCT = (int)Math.Floor(COTime_in * SampleRate_in / 1000);
                this.CutOffTime = COTime_in;
                Rec_Type = Type;
                Point3d[] arrPts = Pt.ToArray<Point3d>();
                Rec_List = new Spherical_Receiver[arrPts.Length];
                Min = new Hare.Geometry.Point(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity);
                Max = new Hare.Geometry.Point(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity);

                for (int i = 0; i < arrPts.Length; i++)
                {
                    if (Type == Type.Stationary) Rec_List[i] = new Spherical_Receiver(new Point3d(arrPts[i]), new Point3d(SrcPT), Sc.Attenuation(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Sound_speed(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Rho(Utilities.PachTools.RPttoHPt(arrPts[i])), SampleRate_in, COTime_in);
                    if (Type == Type.Variable) Rec_List[i] = new Expanding_Receiver(new Point3d(arrPts[i]), new Point3d(SrcPT), RayCount, Sc.Attenuation(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Sound_speed(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Rho(Utilities.PachTools.RPttoHPt(arrPts[i])), SampleRate_in, COTime_in);

                    if (arrPts[i].X > Max.x) Max.x = arrPts[i].X;
                    if (arrPts[i].Y > Max.y) Max.y = arrPts[i].Y;
                    if (arrPts[i].Z > Max.z) Max.z = arrPts[i].Z;
                    if (arrPts[i].X < Min.x) Min.x = arrPts[i].X;
                    if (arrPts[i].Y < Min.y) Min.y = arrPts[i].Y;
                    if (arrPts[i].Z < Min.z) Min.z = arrPts[i].Z;
                }
            }
开发者ID:philrob22,项目名称:PachydermAcoustic_Rhinoceros,代码行数:36,代码来源:Classes_Receivers.cs


注:本文中的Scene.Sound_speed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。