beacon distance in feet

282 views Asked by At

How I can get the distance of a beacon in feet.can any one help me.This code gives me distance in meters

                        int b = Math.round(range);
                        int rssi1=rssi;
                        int txpower=-59;
                        Double distance=getDistance(rssi1,txpower);
                        int a = (int) (distance + 0.5);
3

There are 3 answers

0
Krunal Kapadiya On

You can copy this code in your java file. and can get a distance in feet as,

double distanceInFeet = meterToFeet(distance);


public double meterToFeet(int distanceInMeter) {
    // as 1 meter = 3.28084 feet we have.  
    return 3.28084 * distanceInMeter;
}
0
Priya Singhal On

// 1 metre = 3.28084 feet

                    int b = Math.round(range);
                    int rssi1=rssi;
                    int txpower=-59;
                    Double distance=getDistance(rssi1,txpower);
                    int a = (int) (distance + 0.5);
                    float feet = a*(3.28) ;
0
iOS_MIB On

Just convert meter into feet...

1m = 3.280839895ft

distanceInFeet = distanceInMeter * 3.2808

Hope this will help you :)