public bool EqualsThreshold(EquatorialCoords eq, double threshold) { double ra = RA.Get(); double dec = Declination.Get(); //threshold in degrees return((ra - threshold / 15d) < eq.RA.Get() && eq.RA.Get() < (ra + threshold / 15d) && (dec - threshold) < eq.Declination.Get() && eq.Declination.Get() < (dec + threshold)); }
public override bool Equals(object obj) { if (obj == null) { return(false); } EquatorialCoords otherEq = null; try{ otherEq = obj as EquatorialCoords; }catch (InvalidCastException i) { Debug.Log("Invalid cast"); return(false); } return(RA.Equals(otherEq.RA) && Declination.Equals(otherEq.Declination)); }