vector2ByAngle static method

Vector2 vector2ByAngle(
  1. double angle, {
  2. double intensity = 1,
})

Implementation

static Vector2 vector2ByAngle(double angle, {double intensity = 1}) {
  var x = cos(angle) * intensity;
  var y = sin(angle) * intensity;
  if (x.abs() < 0.01) {
    x = 0;
  }
  if (y.abs() < 0.01) {
    y = 0;
  }
  return Vector2(x, y);
}