package com.google.android.m4b.maps.bv;

import android.graphics.Point;
import com.google.android.m4b.maps.bu.bk.a;
import com.google.android.m4b.maps.g.j;
import com.google.android.m4b.maps.model.CameraPosition;
import com.google.android.m4b.maps.model.LatLng;
import com.google.android.m4b.maps.model.LatLngBounds;
import com.google.android.m4b.maps.model.VisibleRegion;
import com.google.common.base.Preconditions;
import java.util.Arrays;

public final class k
  implements bk.a
{
  public final int a;
  public final int b;
  public final int c;
  public final int d;
  public final CameraPosition e;
  public final int f;
  public final int g;
  public final double h;
  private final double i;
  private final Point j;

  public k(CameraPosition paramCameraPosition, int paramInt1, int paramInt2, double paramDouble, int paramInt3, int paramInt4, int paramInt5, int paramInt6)
  {
    Preconditions.checkNotNull(paramCameraPosition);
    this.a = paramInt3;
    this.b = paramInt4;
    this.c = paramInt5;
    this.d = paramInt6;
    this.e = paramCameraPosition;
    this.f = paramInt1;
    this.g = paramInt2;
    this.h = paramDouble;
    this.i = paramCameraPosition.zoom;
    this.j = new Point(paramInt3 + (paramInt1 - paramInt3 - paramInt5) / 2, paramInt4 + (paramInt2 - paramInt4 - paramInt6) / 2);
  }

  public static double a(double paramDouble1, double paramDouble2)
  {
    return paramDouble2 * (256.0D * Math.pow(2.0D, paramDouble1));
  }

  public static a a(LatLng paramLatLng, double paramDouble1, double paramDouble2)
  {
    if (paramDouble1 >= 0.0D);
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkArgument(bool);
      Preconditions.checkNotNull(paramLatLng);
      double d1 = paramLatLng.longitude;
      double d2 = a(paramDouble1, paramDouble2);
      double d3 = d2 / 2.0D;
      double d4 = Math.sin(Math.toRadians(paramLatLng.latitude));
      double d5 = d3 + d2 * (d1 / 360.0D);
      double d6 = d3 - d2 * (Math.log((1.0D + d4) / (1.0D - d4)) / 4.0D / 3.141592653589793D);
      return new a(()d5, ()d6);
    }
  }

  public final Point a(LatLng paramLatLng)
  {
    a locala1 = a(paramLatLng, this.i, this.h);
    a locala2 = a(this.e.target, this.i, this.h);
    long l1 = locala1.a - locala2.a;
    long l2 = b();
    if (l1 > l2 / 2L)
      l1 -= l2;
    if (l1 < -l2 / 2L)
      l1 += l2;
    return new Point((int)(l1 + this.j.x), (int)(this.j.y + (locala1.b - locala2.b)));
  }

  public final LatLng a(Point paramPoint)
  {
    a locala1 = a(this.e.target, this.i, this.h);
    a locala2 = new a(locala1.a - this.j.x + paramPoint.x, locala1.b - this.j.y + paramPoint.y);
    double d1 = a(this.i, this.h);
    double d2 = 6.283185307179586D * (locala2.a / d1 - 0.5D);
    return new LatLng(Math.toDegrees(2.0D * Math.atan(Math.exp(6.283185307179586D * (0.5D + -locala2.b / d1))) - 1.570796326794897D), Math.toDegrees(d2));
  }

  public final VisibleRegion a()
  {
    LatLng localLatLng1 = a(new Point(this.a, this.b));
    LatLng localLatLng2 = a(new Point(this.f - this.c, this.b));
    LatLng localLatLng3 = a(new Point(this.a, this.g - this.d));
    return new VisibleRegion(localLatLng3, a(new Point(this.f - this.c, this.g - this.d)), localLatLng1, localLatLng2, new LatLngBounds(localLatLng3, localLatLng2));
  }

  public final long b()
  {
    return ()a(this.i, this.h);
  }

  public final boolean equals(Object paramObject)
  {
    if (this == paramObject);
    k localk;
    do
    {
      return true;
      if (paramObject == null)
        return false;
      if (!(paramObject instanceof k))
        return false;
      localk = (k)paramObject;
    }
    while ((j.a(this.e, localk.e)) && (j.a(Integer.valueOf(this.f), Integer.valueOf(localk.f))) && (j.a(Integer.valueOf(this.g), Integer.valueOf(localk.g))) && (j.a(Double.valueOf(this.h), Double.valueOf(localk.h))) && (j.a(Integer.valueOf(this.a), Integer.valueOf(localk.a))) && (j.a(Integer.valueOf(this.b), Integer.valueOf(localk.b))) && (j.a(Integer.valueOf(this.c), Integer.valueOf(localk.c))) && (j.a(Integer.valueOf(this.d), Integer.valueOf(localk.d))));
    return false;
  }

  public final int hashCode()
  {
    Object[] arrayOfObject = new Object[8];
    arrayOfObject[0] = this.e;
    arrayOfObject[1] = Integer.valueOf(this.f);
    arrayOfObject[2] = Integer.valueOf(this.g);
    arrayOfObject[3] = Double.valueOf(this.h);
    arrayOfObject[4] = Integer.valueOf(this.a);
    arrayOfObject[5] = Integer.valueOf(this.b);
    arrayOfObject[6] = Integer.valueOf(this.c);
    arrayOfObject[7] = Integer.valueOf(this.d);
    return Arrays.hashCode(arrayOfObject);
  }

  public static final class a
  {
    public long a;
    public long b;

    public a(long paramLong1, long paramLong2)
    {
      this.a = paramLong1;
      this.b = paramLong2;
    }

    public final boolean equals(Object paramObject)
    {
      if (this == paramObject);
      a locala;
      do
      {
        return true;
        if (paramObject == null)
          return false;
        if (!(paramObject instanceof a))
          return false;
        locala = (a)paramObject;
      }
      while ((j.a(Long.valueOf(this.a), Long.valueOf(locala.a))) && (j.a(Long.valueOf(this.b), Long.valueOf(locala.b))));
      return false;
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bv.k
 * JD-Core Version:    0.6.2
 */