# Celestia/Celx Scripting/CELX Lua Methods/CEL command gotolonglat
### gotolonglat

gotolonglat { time <duration> distance <radiusdistance> up <upvector> longitude <longnumber> latitude <latnumber> }
Go to the currently selected object, taking <duration> seconds, stopping <radiusdistance> from the object, using <upvector> orientation, positioning yourself above the specified longitude <longnumber> and latitude <latnumber> surface coordinates.
Note: The gotolonglat command does not reset the coordinate system. It retains the previously set coordinate system.
Arguments:

#### time <duration>

    The number of seconds to take going to the object. Default is 1.0 second.

#### distance <radiusdistance>

    Describes how far away from the object you want to be positioned, in units of the object's radius, plus 1. Default is 5.0. Special <distance> values are:
   * 0 (zero) is the center of the object. Note: In version 1.3.1, using this value causes the program to incorrectly recognize further positioning values, so do not use zero.
   * 1 is the surface of the object. Note: Traveling to the exact surface level of an object may cause some graphics cards to display random polygons on the display screen, so it is best to use a value slightly above the surface.

#### up <upvector>

    Defines which axis points up, X [1 0 0], Y [0 1 0] or Z [0 0 1]. Default is [0 1 0].

#### longitude <longnumber>

    This value describes the longitude surface coordinate you want to be positioned above, and should be specified as a decimal value in degrees. No default. Longitude is specified as a negative number for the Western hemisphere and as a positive number for the Eastern hemisphere (“+” sign is not necessary).

#### latitude <latnumber>

    This value describes the latidude surface coordinate you want to be positioned above, and should be specified as a decimal value in degrees. No default. Latitude is specified as a negative number for the Southern hemisphere, and as a positive number for the Northern hemisphere (“+” sign is not necessary).
CELX equivalent:
Based on the observer:gotolonglat method.
* Find the target object with name <string> to go to and store in "objectname". In CELX scripting it is not necessary to select "objectname".
* Determine the radius of "objectname" and store in "radius".
* Determine distance in km to goto as: <radiusdistance> * "radius" and store in "distance".
* Convert <longnumber> and <latnumber> from degrees to radians by multiplying degrees with math.pi (= 3.14159265) and divide by 180. The Lua "math.rad" function can also be used for this.
* Define a vector object, to determine which axis points up.
* Get observer instance of the active view and go to the "longitude" and "latitude" surface coordinates at the determined "distance" from the surface of "objectname" in <duration> seconds.
** If no <duration> is given, the default time is 5.0 seconds !!!
** If no <distance> is given, the default is 5 times the objects radius.
** If no <longitude> is given, the default is 0.
** If no <latitude> is given, the default is 0.
** If no <upvector> is given, the default is (0,1,0) --> Y.
* Wait <duration> seconds.
Summarized:
Example: This example selects the Earth and positions the camera over Seattle, Washington, USA.
CEL:
CELX with observer:gotolonglat method:
Back to CEL command index