Pow


Node Information
Returns a specified number raised to the specified power.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
X IN Double ONE FALSE FALSE
Y IN Double ONE FALSE FALSE
Result OUT Double MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Math
{
    [IsNode("Pow")]
    public class MathPow : Node
    {
        Port a = new Port(PortType.IN, typeof(double), AcceptsLinks.ONE, "X");
        Port b = new Port(PortType.IN, typeof(double), AcceptsLinks.ONE, "Y");
        Port res = new Port(PortType.OUT, typeof(double), AcceptsLinks.MULTIPLE, "Result");
        public MathPow()
        {
            NodeType = NodeType.Function;
            ReturnType = typeof(double);
            a.Value = "0";
            b.Value = "0";
            res.Value = "0";
            this.Name = "Pow";
            this.AddPort(a);
            this.AddPort(b);
            this.AddPort(res);
            Information = "Returns a specified number raised to the specified power.";
        }
        public override string Code()
        {
            return "return Math.Pow(" + GetValue(a) + ", " + GetValue(b) + ");";
        }
    }
}