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 7603975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:47:21+00:00 2026-05-30T23:47:21+00:00

I am fairly new to Android programming, but I am getting pretty good at

  • 0

I am fairly new to Android programming, but I am getting pretty good at it (I think: ))
What I am doing is building a situated stories app. It is an app that places audio files at certain GPS markers and enables the user to listen to them at specific locations.

The next step is moving audio files. What I want to do is set a marker at a specific position in a city. (done). Next I want to check the location of a second marker that moves in a circle around it.

What I have so far is this:

public void checkCircularPosition(){
    /*
     * could be a solution?
     * 
    radius = 250; //offset in meters
    gpsLatCenter = 5.1164; //?how can i make this accurate in meters?
    gpsLonCenter = 52.0963; //??how can i make this accurate in meters?

    degree = 0; //should be variable over time (full circle in 1Hr, 3600sec --> 360/3600 =  0,1 deg/s)
    radian;

    radian = (degree/180)*Math.PI;
    gpsCircleLat = gpsLatCenter+Math.cos(radian)*radius;
    gpsCircleLon = gpsLonCenter-Math.sin(radian)*radius;
    */
}

Now, I have checked this code in adobe flash, which made a movie clip move around in a circle. So I know the calculations are somewhat right. But, I have no way of calculating the latitude and longitude of the resulting coordinates.

EDIT!!

i found the solution with the help posted below. still a lot of work to figure out how to use the results. anyway, i posted the resulting function below.

to make this work, you need _radius wich is 6371 (earth’s radius), a bearing, a distance, and a start location.

thanks a lot guys!

public static void destinationPoint(double brng, double dist) {

    dist = dist/_radius;  // convert dist to angular distance in radians
    brng = Math.toRadians(brng);  // 
    double lat1 = Math.toRadians(_lat);
    double lon1 = Math.toRadians(_lon);

    double lat2 = Math.asin( Math.sin(lat1)*Math.cos(dist) + Math.cos(lat1)*Math.sin(dist)*Math.cos(brng) );
    double lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(dist)*Math.cos(lat1), Math.cos(dist)-Math.sin(lat1)*Math.sin(lat2));
    lon2 = (lon2+3*Math.PI) % (2*Math.PI) - Math.PI;  // normalise to -180..+180º

    Log.i(APPTAG, ""+Math.toDegrees(lat2));
    Log.i(APPTAG, ""+Math.toDegrees(lon2));

    Location movLoc = new Location("");
    movLoc.setLatitude(Math.toDegrees(lat2));
    movLoc.setLongitude(Math.toDegrees(lon2));

    Log.i(APPTAG, ""+movLoc);
}
  • 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-05-30T23:47:23+00:00Added an answer on May 30, 2026 at 11:47 pm

    You should check the section Destination point given distance and bearing from start point at this website: http://www.movable-type.co.uk/scripts/latlong.html

    That website has the proper formula for using your start point (gpsLatCenter/gpsLonCenter) and bearing (degree in you code) to compute the final lat/lon (gpsCircleLat/gpsCircleLon).

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

Sidebar

Related Questions

Im fairly new to android dev and I want to build an app that
I'm fairly new to Android/Java and wanted to make an app that displays info
I'm fairly new to Android programming and to Java in general, but I have
I am fairly new to android and I am creating an app that uses
I'm fairly new to Android and just getting familiarized with the common stuff, but
Ok, im fairly new to android but i have managed to teach myself the
fairly new iPhone developer here. Building an app to send RS232 commands to a
I'm fairly new at programming, but I've wondered how shell text editors such as
I have just began opengl programming in android and i am fairly new to
I'm fairly new to Android developing, and I've been assigned to make an app

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.