speedSqr property

double speedSqr

Gets the square of the speed of this particle.

Implementation

double get speedSqr => dx * dx + dy * dy;
void speedSqr=(double value)

Sets the square of the speed of this particle.

If a negative value is provided the direction is flipped and the absolute value is used to calculate the square root.

Implementation

set speedSqr(double value) {
  speed = math.sqrt(value.abs()) * value.sign;
}