Browse Source

Final change to ellipse logic.

refactor/modularize
RUSHIL AMBARISH KADU 8 months ago
parent
commit
78d4fdf00a
  1. 3
      steps/src/drawUtils.js

3
steps/src/drawUtils.js

@ -613,6 +613,7 @@ export function drawCovarianceEllipse(
// Only draw the ellipse for tracks that are not stationary. // Only draw the ellipse for tracks that are not stationary.
if (isStationary) return; if (isStationary) return;
const [radiusA, radiusB] = radii; const [radiusA, radiusB] = radii;
const angledegrees = 90 + angle;
p.push(); p.push();
p.noFill(); p.noFill();
p.stroke(255, 0, 0, 150); p.stroke(255, 0, 0, 150);
@ -621,7 +622,7 @@ export function drawCovarianceEllipse(
position[0] * plotScales.plotScaleX, position[0] * plotScales.plotScaleX,
position[1] * plotScales.plotScaleY position[1] * plotScales.plotScaleY
); );
p.rotate(angle);
p.rotate(p.radians(angledegrees));
p.ellipse(0,0, p.ellipse(0,0,
radiusA * 2 * plotScales.plotScaleX, // multiplied by 2 because ellipse function radiusA * 2 * plotScales.plotScaleX, // multiplied by 2 because ellipse function
radiusB * 2 * plotScales.plotScaleY // in p5 library expect radiusB * 2 * plotScales.plotScaleY // in p5 library expect

Loading…
Cancel
Save