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 javax.swing.JMenuItem;
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
float c=(((150.0f)*(pi))/(180.0f)); // arc radius in radians (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
--
[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 - 00:24:12 EDT