Finishing math school with Unity

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!

I guess i’ll upload the package to. (See attachment)
I improved it to, now has zoom and precision. this gives you full control over the shape etc…

Usefull for doing something like a bunnyhop.

1712364–107849–Mathf Sin.unitypackage (52.8 KB)