1. Map Coordinates

Hey math geniuses, I hope this is the right forums, and I have a rather difficult math question here.

I'm learning games development and currently have a project in the making using DarkBasic, one thing I always fail on is math, luckily the language I use has many libraries of functions available that take a load off, especially when it comes to mathimatics.

Programming logic is no problem for me, but math is where I fail miserably

Anyways what I'm getting to is, I have a virtual world which has a size of 2000.0 x 2000.0, however the actual coordinates for the world are:

x = -1000.0 (West) to +1000.0 (East)
z = -1000.0 (South) to +1000.0 (North)

And 0,0 would be dead center.

I want to create a birds-eye view mini-map of the world, and plot a mark where I am on the mini-map relative to the vitual world, the mini-map would be 500 x 500 pixels, in programming terms in case you don't know this would be:

x = 0 (Left) to 500 (Right)
z = 0 (Top) to 500 (Bottom).

And 250,250 would be dead center, now how would I do the math for this?

Cheers.

2. Originally Posted by W1z8it
...
Programming logic is no problem for me...

a virtual world which has a size of 2000.0 x 2000.0,
the actual coordinates for the world are:

x = -1000.0 (West) to +1000.0 (East)
z = -1000.0 (South) to +1000.0 (North)

And 0,0 would be dead center.

I want to create a birds-eye view mini-map of the world, and plot a mark where I am on the mini-map relative to the vitual world, the mini-map would be 500 x 500 pixels, in programming terms in case you don't know this would be:

x = 0 (Left) to 500 (Right)
z = 0 (Top) to 500 (Bottom).

And 250,250 would be dead center, now how would I do the math for this?

IF the mini-map point WORLD(250,250) matches the virtual-world coordinate point mini(250,250) then it is merely
scale and translation

If all Points in the World-Map [ Wpt(Wx,Wz) ]
are to be mapped to the mini-view [ Mpt(Mx,Mz) ]
Then the mini view is going to be at the ratio of 500/2000 or 0.25
ratio = 500/2000 = 0.25
Scale:
Mx = ratio * Wx
Mz = ratio * Wz
Note: this will grab only every 4th pixel (horizontally/vertically) or
1/16th of the image. You may want to get the average of the pixels
in the world view before plotting in the mini-view.

Translation:
Mx now will be in the range -250 to 250. Same for Mz
Translate to the mini-view dead zero:
Mx = Mx + 250 Mx is now in the range 0 to 500
Mz = Mz + 250 Same for Mz

If you want to have the option of placing the mini-map any place on the world-map, then you will need to remove the hard coded values.

3. How would I work out where to plot the player on the map? if I have the x and z coords?