本文整理汇总了C#中Graph.Read方法的典型用法代码示例。如果您正苦于以下问题:C# Graph.Read方法的具体用法?C# Graph.Read怎么用?C# Graph.Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.Read方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlotGraph
// PlotGraph(): A simple method that helps to plot a graph
void PlotGraph(Graph _graph)
{
for (int i = 0; i < 100; i++)
{
float t = 0.01f * i;
Instantiate(m_Node, new Vector3(t * 10.0f, _graph.Read(t) * 10.0f, 0f), Quaternion.identity);
}
}
示例2: Start
// Private Functions
void Start()
{
m_graphAdd = m_graph + 1f;
m_graphSubtract = m_graph - 1f;
m_graphMultiply = m_graph * 2f;
m_graphDivide = m_graph / 2f;
for (int i = 0; i < 10; i++)
{
float x = (float)i / 10f;
Debug.Log("At " + i + ", Default: " + m_graph.Read(x) + ", Add: " + m_graphAdd.Read(x) + ", Subtract: " + m_graphSubtract.Read(x) + ", Multiply: " + m_graphMultiply.Read(x) + ", Divide: " + m_graphDivide.Read(x));
}
}
示例3: VerticalFlipAsFloat
/// <summary>
/// Flips the graph along the f(x)-direction and returns the x value of the graph
/// </summary>
/// <param name="_graph"> The graph to be flipped </param>
/// <param name="_fFlip"> The value of f(x) at which the graph will be flipped along </param>
/// <param name="_x"> The x value of the graph </param>
/// <returns> Returns the value of f(x) on the flipped graph </returns>
public static float VerticalFlipAsFloat(Graph _graph, float _fFlip, float _x)
{
return _fFlip * 2f - _graph.Read(_x);
}
示例4: MultiplyAsFloat
/// <summary>
/// Returns the product of graph-A and graph-B at x. the operator (_graphA * _graphB).Read() could also be use to represent the same thing;
/// </summary>
/// <param name="_graphA"> The first graph </param>
/// <param name="_graphB"> The second graph </param>
/// <param name="_x"> The x value of the graph </param>
/// <returns> Return the product of both graphs </returns>
public static float MultiplyAsFloat(Graph _graphA, Graph _graphB, float _x)
{
return _graphA.Read(_x) * _graphB.Read(_x);
}
示例5: MixAsFloat
/// <summary>
/// Returns the result at x of graph-A with a certain percentage influenced from graph-B
/// </summary>
/// <param name="_graphA"> The initial graph A </param>
/// <param name="_graphB"> The influencing graph B </param>
/// <param name="_fBInfluence"> The percentage of influenced from the influencing graph B </param>
/// <param name="_x"> The x value of the graph </param>
/// <returns> Returns the f(x) value of the graph </returns>
public static float MixAsFloat(Graph _graphA, Graph _graphB, float _fBInfluence, float _x)
{
return _graphA.Read(_x) * (1f - _fBInfluence) + _fBInfluence * _graphB.Read(_x);
}
示例6: HorizontalFlipAsFloat
/// <summary>
/// Flips the graph along the x-direction and returns the x value of the graph
/// </summary>
/// <param name="_graph"> The graph to be flipped </param>
/// <param name="_fFlip"> The value of f(x) at which the graph will be flipped along </param>
/// <param name="_x"> The x value of the graph </param>
/// <returns> Returns the value of x on the flipped graph </returns>
public static float HorizontalFlipAsFloat(Graph _graph, float _fFlip, float _x)
{
return _graph.Read(_fFlip * 2f - _x);
}
示例7: AverageAsFloat
/// <summary>
/// Returns the average of graph-A and graph-B at x
/// </summary>
/// <param name="_graphA"> The first graph </param>
/// <param name="_graphB"> The second graph </param>
/// <param name="_x"> The x value of the graph </param>
/// <returns> Returns the average of f(x) and g(x) </returns>
public static float AverageAsFloat(Graph _graphA, Graph _graphB, float _x)
{
return (_graphA.Read(_x) + _graphB.Read(_x)) / 2f;
}
示例8: Main
static void Main()
{
Graph graph = new Graph();
graph.Read();
graph.Print();
}