Пример #1
0
        //求得电场的垂直分量
        //调用方法:thisEfield.GetVerticalE(k,l)
        public Plural GetVerticalE(SpectVector k, SpectVector l)  //k为射线传播方向,l为反射中的反射面的法向量或绕射中的与棱平行的向量
        {
            SpectVector n = k.CrossMultiplied(l).GetNormalizationVector();
            Plural      p = n.DotMultiplied(this);

            return(p);
        }
Пример #2
0
        //求得电场的水平分量
        //调用方法:thisEfield.GetVerticalE(k,l)
        public Plural GetHorizonalE(SpectVector k, SpectVector l)
        {
            SpectVector n = k.CrossMultiplied(l);   //入射面的法向量
            SpectVector m = k.CrossMultiplied(n).GetNormalizationVector();
            Plural      p = m.DotMultiplied(this);

            return(p);
        }
Пример #3
0
        /// <summary>
        ///获得直线与无限平面的交点
        /// </summary>
        /// <param viewFace="p">平面</param>
        /// <returns>直线与三角面的交点</returns>
        public Point GetCrossPointBetweenStraightLineAndInfiniteFace(Face viewFace)
        {
            SpectVector vector    = viewFace.NormalVector.GetNormalizationVector();//归一化
            SpectVector rayVector = this.RayVector.GetNormalizationVector();
            double      temp      = rayVector.DotMultiplied(vector);

            if (Math.Abs(temp) < 0.0000001)//如果向量和平面平行则返回null
            {
                return(null);
            }
            else
            {
                double TriD      = vector.a * viewFace.Vertices[0].X + vector.b * viewFace.Vertices[0].Y + vector.c * viewFace.Vertices[0].Z;
                double temp1     = vector.a * this.Origin.X + vector.b * this.Origin.Y + vector.c * this.Origin.Z - TriD;
                double t         = -temp1 / temp;
                Point  tempPoint = new Point(rayVector.a * t + this.Origin.X, rayVector.b * t + this.Origin.Y, rayVector.c * t + this.Origin.Z);
                return(tempPoint);
            }
        }