package com.google.maps.android.ktx.utils;

import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Polygon;
import com.google.maps.android.PolyUtil;
import com.google.maps.android.SphericalUtil;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: Polygon.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u0015\u0010\u0007\u001a\u00020\b*\u00020\u00022\u0006\u0010\t\u001a\u00020\nH\u0086\b\u001a\u001f\u0010\u000b\u001a\u00020\b*\u00020\u00022\u0006\u0010\t\u001a\u00020\n2\b\b\u0002\u0010\f\u001a\u00020\u0001H\u0086\b\"\u0016\u0010\u0000\u001a\u00020\u0001*\u00020\u00028Æ\u0002¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\"\u0016\u0010\u0005\u001a\u00020\u0001*\u00020\u00028Æ\u0002¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0004¨\u0006\r"}, d2 = {"area", "", "Lcom/google/android/gms/maps/model/Polygon;", "getArea", "(Lcom/google/android/gms/maps/model/Polygon;)D", "signedArea", "getSignedArea", "contains", "", "latLng", "Lcom/google/android/gms/maps/model/LatLng;", "isOnEdge", "tolerance", "maps-utils-ktx_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
public final class PolygonKt {
    public static final boolean contains(Polygon polygon, LatLng latLng) {
        Intrinsics.checkNotNullParameter(polygon, "<this>");
        Intrinsics.checkNotNullParameter(latLng, "latLng");
        return PolyUtil.containsLocation(latLng, polygon.getPoints(), polygon.isGeodesic());
    }

    public static /* synthetic */ boolean isOnEdge$default(Polygon polygon, LatLng latLng, double d, int i, Object obj) {
        if ((i & 2) != 0) {
            d = 0.1d;
        }
        Intrinsics.checkNotNullParameter(polygon, "<this>");
        Intrinsics.checkNotNullParameter(latLng, "latLng");
        return PolyUtil.isLocationOnEdge(latLng, polygon.getPoints(), polygon.isGeodesic(), d);
    }

    public static final boolean isOnEdge(Polygon polygon, LatLng latLng, double d) {
        Intrinsics.checkNotNullParameter(polygon, "<this>");
        Intrinsics.checkNotNullParameter(latLng, "latLng");
        return PolyUtil.isLocationOnEdge(latLng, polygon.getPoints(), polygon.isGeodesic(), d);
    }

    public static final double getArea(Polygon polygon) {
        Intrinsics.checkNotNullParameter(polygon, "<this>");
        return SphericalUtil.computeArea(polygon.getPoints());
    }

    public static final double getSignedArea(Polygon polygon) {
        Intrinsics.checkNotNullParameter(polygon, "<this>");
        return SphericalUtil.computeSignedArea(polygon.getPoints());
    }
}