Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Yes, I drew a square using polar coordinates

Name: Anonymous 2020-05-14 22:51

Wow, isn't math amazing? No, it is not amazing.

<html> <canvas width="512" height="512" id="mycanvas"></canvas> <script> mycanvas=document.getElementById("mycanvas"); context=mycanvas.getContext("2d"); function r(th) { return 16/Math.max(Math.abs(Math.cos(th)),Math.abs(Math.sin(th))); } function x(r,th) { return r*Math.cos(th); } function y(r,th) { return r*Math.sin(th); } for (th=0;th<360;th =1){ myth=th/180*Math.PI; myr=r(myth); myx=x(myr,myth); myy=y(myr,myth); myx =mycanvas.width/2; myy =mycanvas.height/2; context.fillStyle = 'black'; context.fillRect(myx,myy,1,1); } </script> </html>

Name: Anonymous 2020-05-15 1:38

so you squared the circle?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List