Ejemplo n.º 1
0
    public static void Main()
    {
        Point3D pointFirst = new Point3D(1, 2, 3);
        Point3D pointSec   = new Point3D(3, 4, 5);

        Console.WriteLine(Distance3D.CalcDistance(pointFirst, pointSec));

        Path firstPath = new Path();

        firstPath.AddPoint(pointSec);
        firstPath.AddPoint(pointFirst);
        firstPath.AddPoint(pointSec);

        PathStorage.SavePath(firstPath);
        List <Path> pathList = PathStorage.LoadPath();

        foreach (var path in pathList)
        {
            Console.WriteLine("--------------");
            foreach (var pointers in path.pointsList)
            {
                Console.WriteLine(pointers);
            }

            Console.WriteLine("--------------");
        }
    }
Ejemplo n.º 2
0
 public WallModel(IfWall ifWall)
 {
     IfWall      = ifWall;
     IfLocation  = new IfLocation(IfWall.IfLocation);
     IfDimension = new IfDimension(IfWall.IfDimension);
     Direction   = IfWall.Direction;
     if (Direction == Direction.Negative)
     {
         Flip(Axis.Other);
         Direction = Direction.Positive;
     }
     MidPoint = Distance3D.DivideDistance(IfWall.IfLocation, IfWall.IfDimension);
     EndPoint = GetEndPoint();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 绕射衰减
        /// </summary>
        /// <param name="flankLine">绕射路径</param>
        /// <param name="flankType">绕射类型</param>
        /// <param name="distance">直线距离</param>
        /// <returns></returns>
        private float flankAttenuation(Geometry flankLine, bool flankType, float distance)
        {
            //  D_(z,i)=10lg[3+(C_2⁄λ) C_3 zK_met]

            float flank = 0;//绕射衰减

            //参数
            float C2 = 20;
            float C3 = 0;

            float z          = 0;                 //声程差
            float Kmet       = 0;                 //参数
            float wavelength = 340 / m_frequency; //波长


            double[] point0 = new double[3];
            double[] point1 = new double[3];
            double[] point2 = new double[3];
            double[] point3 = new double[3];
            flankLine.GetPoint(0, point0);
            flankLine.GetPoint(1, point1);
            flankLine.GetPoint(flankLine.GetPointCount() - 2, point2);
            flankLine.GetPoint(flankLine.GetPointCount() - 1, point3);

            float dss = (float)Distance3D.getPointDistance(point0, point1);
            float e   = (float)Distance3D.getPointDistance(point2, point1);
            float dst = (float)Distance3D.getPointDistance(point3, point2);
            float d   = (float)Distance3D.getPointDistance(point3, point0);

            if (flankType)
            {
                C3 = 1;
                z  = (float)Math.Sqrt((dss + dst) * (dss + dst) + distance * distance) - d;
            }
            else
            {
                C3 = (1 + (5 * wavelength / e) * (5 * wavelength / e)) / (1 / 3 + (5 * wavelength / e) * (5 * wavelength / e));
                z  = (float)Math.Sqrt((dss + dst + e) * (dss + dst + e) + distance * distance) - d;
            }
            Kmet  = z <= 0 ? 1 : (float)Math.Pow(e, -(1 / 2000) * Math.Sqrt(dss * dst * d / 2 / z));
            flank = 10 * (float)Math.Log10(3 + (C2 / wavelength) * C3 * z * Kmet);
            return(flank);
        }