coordinates

get element via coordinates?

High all, I was wondering if it was possible to select an on page element via its coordinates? reason being i'm trying to make an editable page where you can right click on highlighted elements, menu appears and then select from the options give. using the only method i could find that worked to select the element via hover it uses (eve...

SQL: Determine if one coordinate is in radius of another

Lets say i have a Table of rows that contain coordinates. what would be the best way to pull only the rows of coordinates which are in the radius of a another coordinate? To simplify my question, i'm giving the following example: Table like: Columns: Latitude, Longitude. Row1: 23.44444 24.55555 Row2: 32.44444 28.22222 Row3: ...

Translating screen coordinates to sprite coordinates in XNA

I have a sprite object in XNA. It has a size, position and rotation. How to translate a point from the screen coordinates to the sprite coordinates ? Thanks, SW ...

DirectX Sphere Texture Coordinates

I have a sphere with per-vertex normals and I'm trying to derive the texture coordinates for the object using the algorithm: U = Asin(Norm.X) / PI + 0.5 V = Asin(Norm.Y) / PI + 0.5 With a polka dot texture, I get: Here's the same object without the texture applied: The issue I'm particuarly looking at (I know there's a few) is t...

Coordinates Format.

42 SXC 965214 452136 Will someone please tell me what kind of coordinates are the above? How distance can be derived from the above coordinates? I urgently need it. ...

Console App Mouse-Click X Y Coordinate Detection/Comparison

I have a game that I am working on in a C# console application, purely as practice before going on to better methods. As opposed to using something such as a Windows Forms App, which has button functionality built in, I am endeavoring to grab the cursor position (which I know how to do) and compare it to a number of area's inside a conso...

What do I need to have to be ready to write a Compact Framework application communicating with GPS?

Simply I am asked to write an application for a smart device (smart cell phone), which will get the GPS coordinates from the device itself. I have no smart device at all. And I am kind of lost among questions like how can I check if the device have a gps by using the code, if it has how can I obtain them in a "standard" way, do I need ...

Wpf Viewport Coordinates

Hey guys, Im working with wpf 3d, im currently writing a program that will create 3d tiles across the screen left to right, But i need to know what my bounds are on the X, Y i.e (-x-0) (0-x+) so I know when to start another row of tiles. My initial thoughts are trying to figure out a complex algorithm to go from pixels to screen coordina...

SQL search using Haversine in Doctrine

Hi, I want to do a search by coordinates, i.e. I want to have a function that works like this: function getLocationsInCircle($lat, $long, $minDist, $maxDist){ //return all the places that are at least $minDist //kilometers away and no more than $maxDist kilometers away } I have a "location" table that stores all location Ids...

How can I get my own cursor coordinates in Firefox?

I'm currently designing a website and just realized it would help me a lot if I would know my own cursor coordinates. I mostly use Firefox for previewing the new page. So an add-on for Firefox would be great. I checked out Firebug, but didn't find the feature there. Does anyone know how to show the current cursor coordinates in Firefo...

TranslatePoint within a Canvas

I have a scroll viewer in my application that contains a canvas, in which I have a tree custom-drawn tree structure. I'm trying to get the position of a particular node element in the canvas relative to the scroll viewer (so I can scroll to it), but my attempts aren't working. I've tried using marker.TranslatePoint(new Point(0, 0), scro...

Transforming co-ordinates from a rectangle to a parallelogram

Hi all, I am stuck on a simple yet vexing problem with basic geometry. Too bad I don;t remember my high-school co-ordinate geometry and looking for some help. My problem is illustrated in this diagram: I am struggling with transforming a co-ordinate from the rectangle to a resized parallelogram. Any tips, pointers and/or code-examples...

Spherical Coordinates within a range / restriction

The function below returns points on a sphere with a given radius. I want to add restriction such that points cannot be plotted within 30 degrees of the poles of the sphere. public static function randomPoint(radius:Number):Number3D { var inclination:Number = Math.random() * Math.PI*2; var azimuth:Number = Math.random() * Math.PI*...

Android sqlite sort on calculated column (co-ordinates distance)

I am using an SQLITE database to store latitudes and longitudes of locations. I want to be able to sort the results by rough distance from the current location. I already have the current location of the device as a double (lat, lng), the lat and lng in the database are also doubles. What I want is a query that will create a virtual co...

Generating triangular/hexagonal coordinates (xyz)

I'm trying to come up with an iterative function that generates xyz coordinates for a hexagonal grid. Maths has never been easy for me (I'm just not very clever!) and this problem has me stumped. With a starting hex position (say 0,0,0 for simplicty) I want to calculate the coordinates for each successive "ring" of hexagons, as illustrat...

OpenGL 2.0 ES coordinates

Hello, I'm doing my first steps with OpenGL ES 2.0 trying things on my ipod touch. I was wondering how to solve this coordinates issue.. To explain better, I was trying to draw a quad and rotate/translate it using a vertex shader (also because from what I've read it seems the only way to do it). Since I'm working with a ipod I have a 1...

Coordinates calculation Objective-C

I have the following function that I am so close to cracking but can't find a mod function in obj-c. I hope someone can help suss this. -(void)estimatePosition{ float lat1 = 50.000; float lon1 = -1.666; float d = 500; float tc = 90; float lat; float dlon; float lon; lat =asin(sin(lat1)*cos(d)+cos(lat1)...

XNA mouse coords vs objects problem

Hi all, I'm having a problem with the xna framework, I have a stripped down version of my code here to demonstrate. When the mouse is clicked an object is created at that mouse click point and the object is displayed via it's own draw method. What happens is that the first object is created at the correct position (current mouse coords...

Appropriate similarity metrics for multiple sets of 2d co-ordinates

Pardon me if this has been asked/answered before...my searches did not bring it up. I have a collection of 2D co-ordinate sets (on the scale of a 100K-500K points in each set) and I am looking for the most efficient way to measure the similarity of 1 set to the other. I know of the usuals: Cosine, Jaccard/Tanimoto etc. However hoping f...

Vector Transformation with Matrix

Hi all, I'm working on a code to do a software skinner (bone/skin animation), and I'm at the "optimization" phase (the skinner works pretty well and skin a 4900 triangles mesh with 22 bones in 1.09 ms on a Core Duo 2 Ghz (notebook)). What I need to know is : 1) Can someone show me the way (maybe with pseudocode) to transform a float3 (a...