示例#1
0
 /// <summary>
 /// Get point on sin curve at x.
 /// </summary>
 /// <param name="args">Args of sin curve.</param>
 /// <param name="x">Value of x axis.</param>
 /// <returns>The point on sin curve at x.</returns>
 public static Vector3 GetPointAt(SinArgs args, float x)
 {
     return(new Vector3(x, Evaluate(args, x)));
 }
示例#2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="args">Args of sin curve.</param>
 public SinCurve(SinArgs args)
 {
     this.args = args;
 }
示例#3
0
 /// <summary>
 /// Evaluate the value of sin curve at x.
 /// </summary>
 /// <param name="args">Args of sin curve.</param>
 /// <param name="x">Value of x axis.</param>
 /// <returns>The value of sin curve at x.</returns>
 public static float Evaluate(SinArgs args, double x)
 {
     return(args.amplitude * (float)Math.Sin(args.angular * x + args.phase) + args.setover);
 }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public SinCurve()
 {
     args = new SinArgs();
 }