Help with Trig
Why is the center of the satellite displaced when coordinates 0, 0
?
Even noticeably when the line is compressed and increased.
You can see the offset if you delete screen.clear()
And why does it spin counterclockwise when it’s rot +=1
?
init = function()
rot = 0
end
update = function()
rot += 0.05
X = 0 + 16 - 8 + 75 * cos(rot)
Y = 0 + 16 - 8 + 75 * sin(rot)
if not keyboard.SPACE then
screen.clear()
end
end
draw = function()
screen.drawText("Press space to check",-75,75,8,"rgb(255,255,255)")
screen.fillRound(center.x,center.y,8,8,"rgb(255,0,85)")
screen.fillRound(X,Y,8,8,"rgb(85,255,142)")
screen.drawLine(center.x,center.y,X,Y,"rgb(0,85,255)")
end
center = object
x = 0
y = 0
end