Hi guys! So I'm working on a small 2d visualizer. I'm displaying a circle, with a dot that travels counterclockwise around the circle, and two additional dots for the sin and cos (these move vertically and horizontally, respectively). I also display two graphs with respective Sine and Cosine changing over time. The circle's radius is scaled using the size of the window, as are the size of the graphs. Each frame I add a deltaTime to the angle. From there I calculate the positions of the dots sin and cos, using the angle and the circle's radius. For the graphs, I am calculating the vertical position of the graph's latest point (over time) using the axis length, and, respectively, the sin/cos of the angle. This is all working fine. The issue is in the horizontal position of the graph's latest point. I attempted to move the horizontal position by deltaTime each frame, which isn't correct. How would I get the horizontal position to be synchronized to the vertical position? To try and clarify, for example, the vertical position of the sin graph's latest point is calculated using sin(angle), where the angle increases by deltaTime each frame, whereas the horizontal position of the sin graph's latest point is currently being calculated by taking the current horizontal position, and adding deltaTime, each frame. The horizontal position lags behind by a lot. Thanks!
#Math visualizer
3 messages · Page 1 of 1 (latest)