public static String distance ( String latitudeColumn , String longitudeColumn , String latitudeCosineColumn , double latitude , double longitude , MeasureUnit unit , String alias ) { double degree = unit == MILE ? LATITUDE_DEGREE_MI : LATITUDE_DEGREE_KM ; return String . format ( ( Locale ) null , sDistance , degree , latitude , latitudeColumn , degree , latitude , latitudeColumn , degree , longitude , longitudeColumn , latitudeCosineColumn , degree , longitude , longitudeColumn , latitudeCosineColumn , alias ) ; }
Get a result column for the squared distance from the row coordinates to the supplied coordinates . SQLite doesn t have a square root core function so this must be applied in Java when reading the result column value .