- #1
sumerian
- 6
- 0
Hello all,
I am writing a program/game where you can move on a sphere's surface (like you are walking the earth). So I want to tell my object "move 10 meters in that direction", with a velocity-vector. The z-coordinate will never be used so I can construct this vector as:
vx = speed * cos(angle)
vy = speed * sin(angle)
vz = 0
The object is placed on the sphere with:
x = radius * cos(lat) * cos(lon)
y = radius * cos(lat) * sin(lon)
z = radius * sin(lat)
Now I want to know the new coordinates (cartesian or spherical) after the object has moved.
I've been aware of the formula's in the attached image. But i don't quite know how to use them.
Thanks in advance.
I am writing a program/game where you can move on a sphere's surface (like you are walking the earth). So I want to tell my object "move 10 meters in that direction", with a velocity-vector. The z-coordinate will never be used so I can construct this vector as:
vx = speed * cos(angle)
vy = speed * sin(angle)
vz = 0
The object is placed on the sphere with:
x = radius * cos(lat) * cos(lon)
y = radius * cos(lat) * sin(lon)
z = radius * sin(lat)
Now I want to know the new coordinates (cartesian or spherical) after the object has moved.
I've been aware of the formula's in the attached image. But i don't quite know how to use them.
Thanks in advance.