coordinates

Add radius to Longitude and Latitude with C#

Hello, I need to generate a bounding box of min and max latitude and longitude values so I can return addresses within a given radius. I have two func<>'s below to return the range I need to +/- to the lon lat coordinates to establish the bounding box. However I don't think the math is 100% I am using the Haversine formula to generat...

Calculate distance between two x/y coordinates?

i would like to calculate the distance between two x/y coordinates. This calculation itself isn't that difficult, however I need the corners and sides of the grid to be 'connected'. This means on a grid of 500x500 that the point after 499 becomes 0 again. The distance between e.g. 0,0 and 0,495 should be 5 then. Is there any good mathe...

Calculate overlap between two rectangles on x/y grid?

I need to calculate the overlap (amount or yes/no) that two rectangles make on a special x/y grid. The grid is 500x500 but the sides and corners connect (are continuous). So the next point after 499 becomes 0 again. In a previous question I asked for a way to calculate the distance between two points in this grid. This turned out to be ...

Iphone Animation - Calculation to plot Cartesian Coordinates

I have two points (x1, y1) A & (x2, y2) B. I want to animate an image from point A to point B but also have a touch event on that image. What is the best way to accomplish this? I am currently using CGPointMake to manually plot points but I want to be able to just plug in the two coordinates and have a timer loop to move the object. I...

Actionscript strange coords after removeChild is called

Can anyone help me make sense of the following? I create a few squared sprites and then remove the first one and display the coords. The result is: (x=0, y=0, w=208, h=40) 0 208 (x=42, y=0, w=166, h=40) 0 166 The x coordinate is still 0, though width has changed, getBounds shows correct values. I would expect x to change as well....

C# Foreach XML Node

I'm saving 2-dimensional coordinates on an XML file with a structure similar to: <?xml version="1.0" encoding="utf-8" ?> <grid> <coordinate time="78"> <initial>540:672</initial> <final>540:672</final> </coordinate> </grid> I can open the XML file and read it via the XmlTextReader, but how do I loop through the coordinates specifica...

LibGD strange bug when plotting random coordinates

Hey all, I'm using LibGD to plot a bunch of random coordinates and output a png of the result. Here's the code: #include <gd.h> #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(NULL)); gdImagePtr image; FILE *pngout; int num_pixels; int xy; cout << "num_pixels: "; cin >> ...

VB.NET - Mouse Coordinates

Hello everyone, I have a vb.net application, and I want to know how to find the coordinates of the pointer (mouse) when it is clicked on the form. Not much else to say, so I'll leave it like that.. :D Thanks ...

C# Executing timed commands with varying times

I have a timer control and a grid with a List of coordinates for the grid. I was wondering how I could use the timer control or any other control in order to execute code in the interval, coordinate.Time as it varies for each coordinate. Also, thread.sleep(time) is not an option for me. foreach (Coordinate coordinate in this.Macro) ...

iphone sdk compare relative angle between two coordinates

hi! Supos i have two coordinates on a MapView. Hoe can i calculate the angle relative to the north between those two positions? Thanks ...

How to get visual corner (eg. topLeft) of rotated displayObject in actionscript 3?

When rotating a display object (around its center) the visual corner of the element moves (the actual x and y of the "box" remains the same). For example with 45 degrees of rotation the x coordinate will have increased and the y coordinate will have decreased as the top left corner is now at the top center of the "box". I've tried to us...

What is an infinite scaleless quadtree called?

2D spatial indexing question: What do you call a data structure that is essentially an infinite* quadtree whose nodes contain neither absolute coordinates nor absolute scales -- in which the coordinate system of each node has been normalized to the unit square (0,0)-(1,1), and in which the top-level node is not fixed absolutely? It's a...

How to get the absolute coordinates of a view

Hi, I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as getLeft() and getRight() don't work as they all seem to be relative to the parent of the view, thus giving me 0. What is the proper way to do this? If it helps, this is for a 'put the picture back in ord...

latitude/longitude find nearest latitude/longitude - complex sql or complex calculation!

this is little hard one. i have latitude and longitude and i want to pull the record from the database, which has nearest latitude and longitude by the distance, if that distance gets longer then specified one, then don't retrieve it. Table structure: id latitude longitude place name city country state zip sealevel ...

C# and Microsoft Excel 9.0 Object Library (Excel 2000) getting a cell coordinate excel style.

Is there a way with Excel 9.0 Object Library to get a cell coordinate (from a range or cell) "Excel style" for example: A1 or C4 instead of [1,1] and [4,3]? ...

Reverse Java Graphics2D scaled and rotated coordinates

I use Graphics2D in Java to scale and rotate the picture I draw. I now want to be able to tell what the original coordinates were when I click on a certain point in the picture. So given the rotated and scaled coordinates I want to calculate the original ones. Is there a simple way to do this? ...

Generate identical Hashcodes for approximately-similar numbers

I'm creating an application in C# 3.5 that uses the AutoCAD API to read a 2D AutoCAD drawing, make changes to the drawing using defined business logic, then adjust it back in AutoCAD. Due to the nature of the logic, the shape of the drawing has to be re-constructed - e.g. a rectangle is made up of 4 connecting straight lines. I'm creat...

Drawing real coordinates

Hi to all, i've encountered a little problem that i can't find answer to, so i hope to find someone here to help me. So this is the problem. I have a buffer with real numbers (float) that i need to draw on my scope. I implemented a class that can draw integers only and i really don't know how to do that with float numbers as i don't kn...

Moving between co-ordinates, Java Algorithms

Ok this question is going to be a little abstract. I have an icon moving along a line which is represented by a series of coordinates stored in a vector, and I am iterating through them. The distance between coordinates is variable. So sometimes the icon will move slowly and smoothly, and others it will jump several 100 pixels at a time...

Flex - How do I get the absolute X and Y coordinate including HTML offset?

Hey everyone, I am calling a JS function through the ExternalInterface using Flex which requires the absolute X and Y coordinates to create a pop-up menu. The Flex application is displayed on the center of an HTML page, therefore there is an HTML X and Y offset to consider. I have tried using the LocalToGlobal and ContentToGlobal funct...