I am working with a beacon based project one of the major functionality in my project is indoor navigation with beacons for that i tried some 3rd party sdks but nothing helped me. So i decided to do my own trilateration with a set of equations then again i am stucked with it because for my purpose i want to know the approximate distance from user to each of the beacons my beacon proximity values always gives 0,1,3 so how i will get these approximate distance please help me.
My method for calculating the userlocation(x,y)
is given below
-(void)indorLocationCalculationProximity1:(float*)ra proximity2:(float*)rb proximity3:(float*)rc
{
CGPoint a=CGPointMake(100, 0);
CGPoint b=CGPointMake(200,100);
CGPoint c=CGPointMake(0, 100);
float S = (pow(c.x, 2.) - pow(b.x, 2.) + pow(c.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(rc, 2.)) / 2.0;
float T = (pow(a.x, 2.) - pow(b.x, 2.) + pow(a.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(ra, 2.)) / 2.0;
float y = ((T * (b.x - c.x)) - (S * (b.x - a.x))) / (((a.y - b.y) * (b.x - c.x)) - ((c.y - b.y) * (b.x - a.x)));
float x = ((y * (a.y - b.y)) - T) / (b.x - a.x);
}