CodePlexProject Hosting for Open Source Software

1

Vote
I tried to place a 3D cylinder given its (Lat, Lon) coordinate and i'm trying to draw it in the 3D plan view using the following formulas to convert between the geographic and Cartesian coordinates assuming R (earth radius) = 6371000.0 and i convert the
Lat, Lon to radians

**1:**

**2:**

I want to draw any shape with the given center point in geographic coordinates (Lat, Lon) and i want to draw this shape in the 3D plan viewer

Lat = 26.0813055

Lon = -80.1098043

R = 6371000.0

the results :

X = 982856.322980458

Y = -5637208.03609824

Z = 2800985.54193462

when i tried to draw the shape with the given Cartesian (X, Y, Z) values it drawn too far away from the origin (0, 0, 0) so i dont want to map the world i'm only wants to view a smal area about 10km X 10km, so how to map the result point to a small scale in order to be able to draw many shapes beside it and not far from the origin which will be the 3D plan center.

```
x = R * Math.Cos(lat) * Math.Cos(lon)
y = R * Math.Cos(lat) * Math.Sin(lon)
z = R * Math.Sin(lat)
```

And in other pages they using:```
x = R * Math.Cos(Lat) * Math.Sin(Lon)
y = R * Math.Sin(Lat)
z = R * Math.Cos(Lat) * Math.Cos(Lon)
```

I don't know which one is correct by in both ways the (X, Y, Z) results were too much like the following example: (Using the First Equations group)I want to draw any shape with the given center point in geographic coordinates (Lat, Lon) and i want to draw this shape in the 3D plan viewer

Lat = 26.0813055

Lon = -80.1098043

R = 6371000.0

the results :

X = 982856.322980458

Y = -5637208.03609824

Z = 2800985.54193462

when i tried to draw the shape with the given Cartesian (X, Y, Z) values it drawn too far away from the origin (0, 0, 0) so i dont want to map the world i'm only wants to view a smal area about 10km X 10km, so how to map the result point to a small scale in order to be able to draw many shapes beside it and not far from the origin which will be the 3D plan center.

No files are attached

## comments