v1
- by steveruizok 9/14/202200
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
let ellipses = [];

for (let i = 0; i < 10000; i++) {
  ellipses.push([Math.floor(Math.random() * 100), Math.floor(Math.random() * 100), Math.floor(Math.random() * 100), Math.floor(Math.random() * 100), 200]);
}
delete caserun single casemove downdrag and drop case


ready



function pointsOnEllipse(cx, cy, rx, ry, n) {
  const points = Array(n);

  const step = Math.PI / (n / 2);
  let sin = 0;
  let cos = 1;

  const a = Math.cos(step);
  const b = Math.sin(step);

  for (let i = 0; i < n; i++) {
    points[i] = { x: cx + rx * cos, y: cy + ry * sin };
    const ts = b * cos + a * sin;
    const tc = a * cos - b * sin;
    sin = ts;
    cos = tc;
  }

  return points;
}


for (let i = 0, n = ellipses.length; i < n; i++) {
  const ellipse = ellipses[i];
  pointsOnEllipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3], ellipse[4]);
}
delete caserun single casemove upmove downdrag and drop case


ready



function pointsOnEllipse(cx, cy, rx, ry, n) {
  const xs = Array(n)
  const ys = Array(n)
  
  const step = Math.PI / (n / 2);
  let sin = 0;
  let cos = 1;

  const a = Math.cos(step);
  const b = Math.sin(step);

  for (let i = 0; i < n; i++) {
    xs[i] = cx + rx * cos
    ys[i] = cy + ry * sin
    const ts = b * cos + a * sin;
    const tc = a * cos - b * sin;
    sin = ts;
    cos = tc;
  }

  return {xs, ys};
}


for (let i = 0, n = ellipses.length; i < n; i++) {
  const ellipse = ellipses[i];
  pointsOnEllipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3], ellipse[4]);
}
delete caserun single casemove updrag and drop case


ready



function pointsOnEllipse(cx, cy, rx, ry, n) {
  const xs = new Float32Array(n)
  const ys = new Float32Array(n)
  
  const step = Math.PI / (n / 2);
  let sin = 0;
  let cos = 1;

  const a = Math.cos(step);
  const b = Math.sin(step);

  for (let i = 0; i < n; i++) {
    xs[i] = cx + rx * cos
    ys[i] = cy + ry * sin
    const ts = b * cos + a * sin;
    const tc = a * cos - b * sin;
    sin = ts;
    cos = tc;
  }

  return {xs, ys};
}


for (let i = 0, n = ellipses.length; i < n; i++) {
  const ellipse = ellipses[i];
  pointsOnEllipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3], ellipse[4]);
}
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN