Dear all,

I am working on a small app that can calculate the distance between
actual location and a predefined location.

I am using the commands location.getLatitude and location.getLongitude
to get the GPS position in Degrees Decimal Degrees.

I define a fixed location as double like
double Fixed_Lat = 55.80000;
double Fixed_Long =  12.80000;

>From here I would like to calculate the distance by first calculate
the Distance_square (works fine)
double Distance_square = (Fixed_Lat -
location.getLatitude())*(Fixed_Lat - location.getLatitude()) +
(Fixed_Long - location.getLongitude())*(Fixed_Long -
location.getLongitude());

Hereafter I would like to calculate the Distance by taking the
squareroot of Distance_square
Unfortunately it seems like that square root requires a float instead
of a double.
I have tried to use
float Distance = FloatMath.sqrt(double Distance_square);
but without any success

Please, let me know how I can solve this problem. I believe that there
must be easier way to calculate this distance, but I have found any.
I am looking forward to your help.

best Regards
ckloch

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to