Moving point in a circle?
Posted: Sat Aug 27, 2016 6:01 pm
I'm using love.graphics.polygon to make a triangle, and I'm trying to move the last x and y coordinates change slowly, in a circular motion, so that the triangle kinda represents a shadow as the sun moves about its cycle.
However, I can't figure out how to do this, I found a thread for a different programming language that has someone describing how to do it:
However, I can't figure out how to do this, I found a thread for a different programming language that has someone describing how to do it:
but i wasnt able to apply this, if someone could give me a hand I'd appreciate itx = cx + Math.sin(time)*rad;
y = cy + Math.cos(time)*rad;
cx,cy are the center of the circle and
rad is the radius of the circle.
As time goes from 0 to 2*PI (or multiples thereof), the x,y values will describe a complete circle.