# campos

Set or get position of camera for Satellite Scenario Viewer

## Syntax

``campos(viewer,lat,lon)``
``campos(viewer,lat,lon,height)``
``campos(viewer)``
``[latOut,lonOut,heightOut] = campos(___)``

## Description

````campos(viewer,lat,lon)` sets the latitude and longitude of the camera for the specified Satellite Scenario Viewer.```

example

````campos(viewer,lat,lon,height)` sets the latitude, longitude, and ellipsoidal height of the camera. If you want to set only the height of the camera, use the `camheight` function instead.```
````campos(viewer)` displays the latitude, longitude, and ellipsoidal height of the camera as a three-element vector. `satelliteScenarioViewer` objects use the WGS84 reference ellipsoid.```
````[latOut,lonOut,heightOut] = campos(___)` sets the position and then returns the latitude, longitude, and height of the camera. Specify any input argument combinations from previous syntaxes.```

## Examples

collapse all

Create a satellite scenario object.

`sc = satelliteScenario;`

Launch the Satellite Scenario Viewer.

`v = satelliteScenarioViewer(sc);`

In the Satellite Scenario Viewer, set the latitude and longitude of the camera to $-$30 degrees and the height of the camera to 30,000 km.

```latitude = -30; % degrees longitude = -30; % degrees height = 30000000; % meters campos(v,latitude,longitude,height)```

## Input Arguments

collapse all

Satellite Scenario Viewer, specified as a scalar `satelliteScenarioViewer` object.1

Geodetic latitude of the camera in degrees, specified as a scalar in the range [–90, 90].

Geodetic longitude of the camera in degrees, specified as a scalar in the range [–360, 360].

Ellipsoidal height of the camera in meters, specified as a numeric scalar.

If you specify the height such that the camera is level with or below the surface of the Earth, then the `campos` function sets the height to a value one meter above the surface.

## Output Arguments

collapse all

Geodetic latitude of the camera in degrees, returned as a numeric scalar.

Geodetic longitude of the camera in degrees, returned as a numeric scalar.

Ellipsoidal height of the camera in meters, returned as a numeric scalar. For more information about ellipsoidal height, see Geodetic Coordinates.

## Version History

Introduced in R2021a

1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.