/// <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))); }
/// <summary> /// Constructor. /// </summary> /// <param name="args">Args of sin curve.</param> public SinCurve(SinArgs args) { this.args = args; }
/// <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); }
/// <summary> /// Constructor. /// </summary> public SinCurve() { args = new SinArgs(); }