Пример #1
0
        /// <inheritdoc/>
        public override ExpNode Execute(VectorProjOperNode node)
        {
            if (node.LeftChild.AreEqualSizeVectors(node.RightChild, out TensorNode a, out TensorNode b))
            {
                VectorProductOperNode adotb = QuickOpers.DotProduct(a, (TensorNode)b.Clone());
                BOperNode             bdotb = QuickOpers.DotProduct((TensorNode)b.Clone(), (TensorNode)b.Clone());

                return(QuickOpers.Multiply(b, adotb, QuickOpers.Reciprical(bdotb)).Execute(this));
            }

            return(HandleError(new CannotVectorProject(this, node)));
        }