Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2009-03-12 13:07:50

aleclarsen12
Member
Registered: 2008-06-01
Posts: 36

Latitude and Longitude

I am writing a program that takes peoples IP addresses and converts it to their geographical location.
I was able to write an engine that converts the IP to Latitude and Longitude.
Now I want to display this on a small image map (show below).

blackout.png

The problem is that I do not know how to convert the Latitude and Longitude to X,Y cords on the map.

imageg.gif

Just to further complicate things, in computers X,Y is different.
Although you would expect (0,0) to be in the center of the image, it is accualy in the upper right hand corner of the image.
Each interager represents 1 pixel. And everthing in the third section is positive.

I hope I explained that well. If not here is a formula(s):
New X = (-1 * OldX) - (ImageWidth / 2)
New Y = (-1 * OldY) - (ImageHeight / 2)

Thanks!:D


Twitter: http://twitter.com/AlecBeta
Blog: http://AlecBeta.us.to

Offline

#2 2009-03-13 03:19:29

Onyx
Member
Registered: 2009-02-24
Posts: 48

Re: Latitude and Longitude

There is something in topology called Reimannian manifolds which are manifolds that allow you to measure distances and angles:

http://en.wikipedia.org/wiki/Riemannian_manifolds

or take a look at manifolds in general:

http://en.wikipedia.org/wiki/Manifold

Offline

Board footer

Powered by FluxBB