Step 1) Get a subject
(In my case; Sin, Cos, Tan) and test in Wolframa copying your formule from any Science page.
Scienepage: http://www.biology.arizona.edu/biomath/tutorials/trigonometric/graphtrigfunctions.html
Wolframa: y=sin(x) - Wolfram|Alpha
Step 2)
Build a proof of concept in Unity
private LineRenderer r;
void Awake () {
r = GetComponent<LineRenderer> ();
}
void Update () {
r.SetVertexCount (1);
r.SetPosition (0, new Vector3 (0, 0, 0));
int i = 0;
for (int x=0; x<10; x++) {
float y = Mathf.Sin(x);
i++;
r.SetVertexCount (i+1);
r.SetPosition (i, new Vector3 (x, y, 0));
}
}
Step 3) Run the scene!
Step 4) Observe and learn!