I see that in order to draw a rectangular path you can use a formula similar to the one found here.
I am wondering if there is something similar for a rectangular path?
EDIT: I'm looking to be able to have one point draw out the entire rectangular path in steps rather than to just have the entire rectangle appear.
i.e.
function redraw () {
//
Code for the animation, while keeping track of last point
(such that the end animation is continuous)
//
clearScreen();
ctx.beginPath();
ctx.rect(x,y,5,5);
ctx.stroke();
}
setInterval(redraw, 16);
redraw();
I'd prefer not using any external libraries as well