Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8774461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:34:26+00:00 2026-06-13T18:34:26+00:00

I’m experiencing some issues with my radar view, I’m pretty close to have the

  • 0

I’m experiencing some issues with my radar view, I’m pretty close to have the solution but I can’t figure out what’s wrong. I’ve created a class radarView for this purpose. The thing is, when I’m browsing the locations all around me, the locations represented by several white points are all scattered on the diagonal of the radar view starting from the upper left corner to the lower right corner.

Here is how I calculate the coordinates of the points depending on the difference between the azimuth of the location and my own azimuth:

-(float)calculateDelta:(double*)currentAzimuth withLoc:(ARGeoLocation *)location{
double deltaAzimuth;
deltaAzimuth = ABS(location.locationAzimuth - *currentAzimuth);

if (*currentAzimuth < 0.0)
    *currentAzimuth = 2*M_PI + *currentAzimuth;

else if (*currentAzimuth > 2*M_PI)
    *currentAzimuth = *currentAzimuth - 2*M_PI;

deltaAzimuth = location.locationAzimuth - *currentAzimuth;

if (deltaAzimuth < 0.0)
    deltaAzimuth = 2*M_PI + deltaAzimuth;

else if (deltaAzimuth > 2*M_PI)
    deltaAzimuth = deltaAzimuth - 2*M_PI;

return deltaAzimuth;
}


-(float)calculateXPointWithLoc:(ARGeoLocation *)loc andDelta:(float)delta{
float angle = radiansToDegrees(delta);
float dpx = ([myPos distanceFromLocation:loc.geoLocation]*20)/DISTANCE_FILTER;

if(0<=angle<=90)
    return self.center.x + sin(angle)*dpx;
else if(90<angle<=180)
    return self.center.x + cos(angle-90)*dpx;
else if(180<angle<=270)
    return self.center.x - cos(270-angle)*dpx;
else if(270<angle<360)
    return self.center.x - sin(360-angle)*dpx;
}

-(float)calculateYPointWithLoc:(ARGeoLocation *)loc andDelta:(float)delta{
float angle = radiansToDegrees(delta);
float dpx = ([myPos distanceFromLocation:loc.geoLocation]*20)/DISTANCE_FILTER;

if(0<=angle<=90)
    return self.center.y - cos(angle)*dpx;
else if(90<angle<=180)
    return self.center.y + sin(angle-90)*dpx;
else if(180<angle<=270)
    return self.center.y + sin(270-angle)*dpx;
else if(270<angle<360)
    return self.center.y - cos(360-angle)*dpx;
}

Above dpx represents the distance that the location should have in pixels from the center of the radar view.
And finally with these data I update the points on the radar, there are in fact UIView stored in an array “plots” in the class radarView:

-(void)updateRadar:(double*)currentAzimuth andRange:(float)range{
float x,y;
int i=0;
float deltaAz;
for(ARGeoLocation *loc in coordinates){
    deltaAz = [self calculateDelta:currentAzimuth withLoc:loc andRange:range];

    x = [self calculateXPointWithLoc:loc andDelta:deltaAz];
//        NSLog(@"x: %f",x);
    y = [self calculateXPointWithLoc:loc andDelta:deltaAz];
//        NSLog(@"y: %f",y);
    [[plots objectAtIndex:i] setFrame:CGRectMake(x, y, DIAMETER_PLOT, DIAMETER_PLOT)];
    i++;
}
}

Is there anyone who already experienced creating a radar view?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:34:28+00:00Added an answer on June 13, 2026 at 6:34 pm

    My bad I shouldn’t have asked this question. I guess I was too tired when I did it, my calculations were not wrong, I didn’t realized I made a stupid copy and paste, so instead of:

    y = [self calculateXPointWithLoc:loc andDelta:deltaAz];
    

    I should have written:

    y = [self calculateYPointWithLoc:loc andDelta:deltaAz];
    

    I was really disappointed when the debugger made me realize it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.