示例#1
0
        public Vector3d TangentVector2d(Point point)
        {
            if (!this.ContainsOnCircumference(point))
            {
                return(null);
            }
            double   norm      = this.vector3d_0.Norm;
            double   norm2     = this.vector3d_1.Norm;
            Vector3d vector3d  = new Vector3d(point - this.point_0);
            Vector3d vector3d2 = vector3d.ProjectParallelOn(this.vector3d_0);
            Vector3d vector3d3 = vector3d.ProjectParallelOn(this.vector3d_1);
            double   num       = (double)Math.Sign(Vector3d.Dot(vector3d2, this.vector3d_0)) * vector3d2.Norm;
            double   num2      = (double)Math.Sign(Vector3d.Dot(vector3d3, this.vector3d_1)) * vector3d3.Norm;
            double   scalar    = -norm / norm2 * num2;
            double   scalar2   = norm2 / norm * num;

            return(scalar * this.vector3d_0.Normalize() + scalar2 * this.vector3d_1.Normalize());
        }