package com.amplifyframework.geo.models;

import s3.d;

/* loaded from: classes4.dex */
public final class Coordinates implements Geometry {
    private double latitude;
    private double longitude;

    public Coordinates() {
        this(0.0d, 0.0d);
    }

    public double centralAngle(Coordinates coordinates) {
        double radians = Math.toRadians(this.latitude - coordinates.latitude);
        double d10 = radians / 2.0d;
        double radians2 = Math.toRadians(this.longitude - coordinates.longitude) / 2.0d;
        double sin = (Math.sin(d10) * Math.sin(d10)) + (Math.sin(radians2) * Math.sin(radians2) * Math.cos(Math.toRadians(this.latitude)) * Math.cos(Math.toRadians(coordinates.latitude)));
        return Math.atan2(Math.sqrt(sin), Math.sqrt(1.0d - sin)) * 2.0d;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || Coordinates.class != obj.getClass()) {
            return false;
        }
        Coordinates coordinates = (Coordinates) obj;
        return d.a(Double.valueOf(this.latitude), Double.valueOf(coordinates.latitude)) && d.a(Double.valueOf(this.longitude), Double.valueOf(coordinates.longitude));
    }

    public double getLatitude() {
        return this.latitude;
    }

    public double getLongitude() {
        return this.longitude;
    }

    public int hashCode() {
        return d.b(Double.valueOf(this.latitude), Double.valueOf(this.longitude));
    }

    public void setLatitude(double d10) {
        this.latitude = d10;
    }

    public void setLongitude(double d10) {
        this.longitude = d10;
    }

    public String toString() {
        return "Coordinates{latitude=" + this.latitude + ", longitude=" + this.longitude + '}';
    }

    public Coordinates(double d10, double d11) {
        this.latitude = d10;
        this.longitude = d11;
    }
}
