[OpenLayers-Users] Finding points

Vinicius Carvalho viniciusccarvalho at gmail.com
Wed Mar 23 12:49:57 EDT 2011


Hi there! I have a really basic question here.

I have a point and from there I would like to get another 2 points to create
a triangle. That's pretty basic trigonometry stuff.

The only issue, is that I'm trying to get it to work with the lat/lon
coordinate system.

What I want is given a point A (10,10) and a radius in meters, for example
30 meters I want to find the pair of points that are 30 degrees up and 30
degrees down.

Normally I would do is x1 = x+r*cos(30)

problem is while x is in a decimal lat, r is in meters.

I'm converting 1meter in decimal as follow:

value = 1d/(30.9)*Math.cos(Math.toRadians(Math.abs(latitude)));
return value/3600;

But when I add the markers on the map they are way closer than supposed to
be. I'm using OSM and first I create the LonLat on decimal format  (all
points) and then I transform them.

Any ideas on what am i missing here?

Regards




-- 
The intuitive mind is a sacred gift and the
rational mind is a faithful servant. We have
created a society that honors the servant and
has forgotten the gift.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110323/8da47a5f/attachment.html


More information about the Users mailing list