position method

Offset position(
  1. int particleNumber
)

Implementation

Offset position(int particleNumber) {
  var rand = sin(particleNumber).abs();
  var rvalue = (value + rand * 2 * pi) % (2 * pi);

  var x = sin(-rand + rvalue + offset) * canvasSize.width / 2;
  var y = sin(rand + -2 * rvalue + offset) * canvasSize.height / 2;

  return Offset(canvasSize.width / 2 + x, canvasSize.height / 2 + y);
}