coordinates

Convert Lat/Longs to X/Y Co-ordinates

I have the Lat/Long value of New York City, NY; 40.7560540,-73.9869510 and a flat image of the earth, 1000px × 446px. I would like to be able to convert, using Javascript, the Lat/Long to an X,Y coordinate where the point would reflect the location. So the X,Y coordinate form the Top-Left corner of the image would be; 289, 111 Things ...

Given an angle and dimensions, find a coordinate along the perimeter of a rectangle

I'm writing a script where icons rotate around a given pivot (or origin). I've been able to make this work for rotating the icons around an ellipse but I also want to have them move around the perimeter of a rectangle of a certain width, height and origin. I'm doing it this way because my current code stores all the coords in an array ...

How to calculate a point on a rotated axis?

How can I calculate a point (X,Y) a specified distance away, on a rotated axis? I know what angle I'd like the point "moving" along (in degrees). ...

Google Maps - Panning and Zooming into areas - markers not appearing when I zoom in or pan - HELP!

Hi guys, I'm implementing some boundary based clustering on the server end of markers to display on my google maps. What I'm doing is that I have a function that is called everytime the map is moves or panned or zoomed which takes the bound of the map and makes an ajax call which in turn the server side script runs a simple sql query to ...

Finding the coordinates of tiles that are covered by a rectangle with x,y,w,h pixel coordinates

Say I have a tile based system using 16x16 pixels. How would you find out what tiles are covered by a rectangle defined by floating point pixel units? for eg, rect(x=16.0,y=16.0, w=1.0, h=1.0) -> tile(x=1, y=1, w=1, h=1) rect(x=16.0,y=16.0, w=16.0, h=16.0) -> tile(x=1, y=1, w=1, h=1) (still within same tile) rect(x=24.0,y=24.0, w=8....

Swapping X,Y coordinates in a rectangle, what is this operation called?

Trying to find a good name for a method swapping each coordinate X and Y values. Is there a name for this operation? Essentially, here's what is done (1, 2) -> (2, 1) On a polygon, this is the same as having a rotation of -90 degrees and doing a horizontal flip or mirror. ...

Is there a simple "point in rect" algorithm for a wraparound map?

I'm trying to build a rectangular grid that can wrap around at the edges. Anyone who plays video games will probably be familiar with the concept: go far enough in one direction on the world map and you'll end up back where you started. This causes some difficulty in setting up the viewport, though, since the edges can scroll into nega...

Calculating SVG paths

Hi guys I have a quite complex image map (made up of over 150 pieces) and I want to convert the coords within the map to SVG path standard format. The reason why is I want to use the following instead of an image map http://raphaeljs.com/australia.html. But I need the coords to be in SVG path standard format. How can I convert an imag...

Linear relationships for two (x,y) graphs

I have x,y data coming in from a [coordinates1] database (GIS - but this could be any database). I have my application with it's own coordinate system, referencing THE SAME MAP. I have established that a linear relationship exists between coordinates1(x,y) and coordinates2(x,y) as I have subtracted two different coordinates1 and coordin...

GPS coordinates in degrees to calculate distances

On the iPhone, I get the user's location in decimal degrees, for example: latitude 39.470920 and longitude = -0.373192; That's point A. I need to create a line with another GPS coordinate, also in decimal degrees, point B. Then, calculate the distance (perpendicular) between the line from A to B and another point C. The problem is I ge...

How to get the MouseEvent.localX and localY of a target but not its child objects?

I'm creating a simple drawing application that adds new Shape objects to a MovieClip "canvas" every time the user clicks and drags. The problem is, I'm noticing that even though the MouseEvent listeners are set to the MovieClip, the child Shape objects are being returned as targets as well. This disrupts the localX and localY as well, ...

How to partition a plane

Let's say I have a fixed number (X) of points, e.g. coordinates within a given plane (I think you can call it a 2-D point cloud). These points should be partitioned into Y polygons where Y < X. The polygons should not overlap. It would be wonderful if the polygons were konvex (like a Voronoi diagram). Imagine it like locations formin...

Obtain a window coordinates from processID or hWnd

Hi, does anyone know if you can get the coordinates of a window using the .NET framework or via pinvoking? I would have the processID or mainwindowhandle. ...

Web service to get the GPS Coordinates

Hi all, I'm developing an web application (jsp/strtus2) which requires the GPS coordinates of a place. What I want to know is, whether there are any free web services that I can get GPS coordinates of a place by passing address or zip code to the server. Thanks in advance, Nuwan ...

How to get the screen coordinate of web-page elements in BHO

Hi all, I am writing a BHO object for IE. I want the screen position of the top-left of the web-page. How can i get this position? The topleft of the first element in DOM returns (0,0). The webBrowser.Left or Top returns the position of the browser but not the top-left of the page. I am using IWebBrowser2. Thanks a million, -anony. ...

mapping from normalized device coordinates to view space

Hey there! I'd like to map from normalized device coordinates back to viewspace. The other way arround works like this: viewspace -> clip space : multiply the homogeneous coordinates by the projection matrix clip space -> normalized device coordinates: divide the (x,y,z,w) by w now in normalized device coordinates all coordinates wh...

Convert NSNumber to CLCoordinate

I want to pull a list of coordinates from a database into an array (Before displaying them on a map). however, in the database they are of type Number, and I can't figure out how to convert them to coordinates. This doesn't work: Where I have an ATM object (The coordinates are for atm machines) with NSNumbers for latitude and longitude....

Converting Longitude & Latitude to X Y on a map with Calibration points

If i have a jpeg map with size sizeX, sizeY and some calibration points on the map (X, Y, Lon, Lat) What would be the algorithm for calculating the corresponding XY point in the map with a given Longitude / Latitude pair? ...

two sets of 3d points

Hi everybody, I´ve got a question concerning two sets of points in a 3d space. I defined a volume by 40 coordinates in one cartesian coordinate system, in another coordinate system with different (0,0,0) i have s slightly different volume also defined by 40 coordinates. I know the matching pairs of the point sets and I want to measure t...

Specifying a non-fullscreen OpenGL ES view

Hi, Anyone know how to create an OpenGL ES app that doesn't use the full iPhone screen dimensions as its drawing surface? Everything I've seen so far has the EAGLView (or whatever) drawing to 0, 0, 320, 480. I'd like to have my EAGLView at 100, 100, 100, 100. Is this possible? It seems all I'd need to do is change the glViewport() c...