vectorInterpolateOptimized static method

ILatLng vectorInterpolateOptimized(
  1. Float32x4 delta,
  2. Float32x4 min,
  3. double t
)

Implementation

static ILatLng vectorInterpolateOptimized(
    Float32x4 delta, Float32x4 min, double t) {
  var multiplier = Float32x4.splat(t);

  var value = min + delta * multiplier;

  var xxxx = value.shuffle(Float32x4.xxxx);
  var yyyy = value.shuffle(Float32x4.yyyy);

  var powerX = xxxx * xxxx;
  var powerY = yyyy * yyyy;

  var sum = powerX + powerY;

  var sqrt = sum.sqrt();

  final lat = math.atan2(value.z, sqrt.x);
  final lng = math.atan2(yyyy.y, xxxx.x);

  return ILatLng.point(lat.degrees, lng.degrees);
}