I am trying to draw lissajous curves using the canvas and [javascript](/questions/tagged/javascript "show questions tagged 'javascript'"). I have put the formula's in but instead of drawing nice curves, the canvas looks like a complete mess. The code im currently using is:

```
<canvas id="myCanvas" width="720" height="720" style="border:1px solid #d3d3d3;">
<script src="canvas.js"> </script>

```

And for my [javascript](/questions/tagged/javascript "show questions tagged 'javascript'"):

```
var canvas = document.querySelector('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var ctxt = canvas.getContext('2d');

var x;
var y;
var STARTi = 0;
var MAXi = 100;
var yOffset = canvas.height / 2;
var xOffset = canvas.width / 2;
var xAmp = 2;
var yAmp = 3;
var xFreq = 6;
var yFreq = 3;
var phaseDiff = Math.PI / 2;

//X-Axis
ctxt.beginPath();
ctxt.setLineDash([5, 15]);
ctxt.moveTo(0, canvas.height / 2);
ctxt.lineTo(canvas.width, canvas.height / 2);
ctxt.strokeStyle = "rgba(169,169,169)"
ctxt.stroke();

//y-Axis
ctxt.beginPath();
ctxt.setLineDash([5, 15]);
ctxt.moveTo(canvas.width / 2, 0);
ctxt.lineTo(canvas.width / 2, canvas.height);
ctxt.strokeStyle = "rgba(169,169,169)"
ctxt.stroke();

ctxt.setLineDash([0, 0]);

function xCoord(a) {
  return 100 * (xAmp * Math.sin(xFreq * (0.4 * a) + phaseDiff));
}

function yCoord(a) {
  return -100 * (yAmp * Math.sin(yFreq * (0.4 * a)));
}

x = xCoord(STARTi);
y = yCoord(x);
ctxt.beginPath();
ctxt.moveTo(x + xOffset, y + yOffset)

for (i = STARTi; i < MAXi; i++) {

  ctxt.moveTo(x + xOffset, y + yOffset)
  x = xCoord(i);
  y = yCoord(x);
  ctxt.lineTo(x + xOffset, y + yOffset)

  ctxt.strokeStyle = "black"
  ctxt.stroke();
}

```

Im trying to get these curved and i have tried things such as making the increase of the value so small that it will eventually look smooth: didn't work, just crashed my browser eventually. 
I also tried to draw these lines using the `Arc` property. This gave me some smooth lines, but not ones that looked like lisajous curves. I believe this mainly is because i did not know what values or variables in needed to put in for the other required parameters. 

I hope it is a little bit clear what i have problems with. 
Thanks in advance for all the help. ;)