Re: [OpenMap Users] getting a new latitudes and longitude points from another latitude and longitude

From: Don Dietrick <dietrick_at_bbn.com>
Date: Thu, 29 Sep 2005 18:17:57 -0400

c should be in radians, you can use the com.bbn.openmap.proj.Length
class to convert from other units (km, miles, etc).

Az should also be in radians. You can use the Length class, or the
java Math class to convert to radians. west isn't 270, it's -90, but
you have to convert to radians, too.

- Don

On Sep 29, 2005, at 12:19 AM, kedar myadam wrote:

> Hi all,
>
> i am trying to figure out the new latitude and
> longitude from a given point(lat,lon). I think i am messing some
> things around. I am not sure what the c - arc radius in radians
> (0 < c <= PI) // what exactly is the arc radius... should i
> convert Kilometers to radians or some other units to radians. Az -
> azimuth (direction) east of north (-PI <= Az < PI) // i guess North
> is 0 and East 90, South 180 and west is 270.
> I am attaching an image to this mail, that would explain it
> clearly. The center is at lat,lon(28,-80). and the image represents
> 150 kms. I am trying to map on to mapbean. For doing that i need to
> know top left cordinates and lower right coordinates. I have
> written the code for it but i guess i am doing something wrong, i
> am ending up getting some wrong coordinates. Can someone tell me
> where i am wrong.
>
> Here is my code,
>
> [code]
>
>
>
> import java.awt.event.ActionEvent;
> import java.util.ArrayList;
> import java.util.List;
> import javax.swing.ImageIcon;
>
>
> import com.bbn.openmap.event.MapMouseEvent;
> import com.bbn.openmap.layer.OMGraphicHandlerLayer;
> import com.bbn.openmap.omGraphics.OMGraphic;
> import com.bbn.openmap.omGraphics.OMGraphicList;
> import com.bbn.openmap.omGraphics.OMScalingIcon ;
> import com.bbn.openmap.omGraphics.OMScalingRaster;
> import java.awt.image.*;
> import java.awt.*;
> import java.net.*;
>
> import com.bbn.openmap.proj.GreatCircle;
> import com.bbn.openmap.LatLonPoint;
>
>
> public class GetCordinates
> {
>
> public static void main(String[] args)
> {
> GreatCircle gc= null;// = new GreatCircle();
> LatLonPoint lt = new LatLonPoint();
>
> float pi=3.1415f ;
> float phi1=(((28.5f)*(pi))/(180.0f)); //start point latitude
> float lam=(((-80.0f)*(pi))/(180.0f)); // start point longitude
> (0 < c <= PI)
> float Az=315.0f //(Azimuth) North-
> west, I dont know whether i am right
>
>
> lt = gc.spherical_between(phi1,lam,c,Az);
> float latit=lt.getLatitude();
> float longit = lt.getLongitude();
>
> System.out.println(" "+latit+ " " +longit);
>
> float b=lt.azimuth(lt);
> System.out.println(" "+b);
> }
>
> }
>
> [/code]
>
>
> thanks,
>
> kedar
> <img.jpg>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

```--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
```
Received on Thu Sep 29 2005 - 18:18:58 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT