$LastChangedDate: 27-Juil-2011 $

# CL_gm_visiParams

Visibility parameters (angles, distance, ...) for a spherical planet

## Calling Sequence

       [par2]=CL_gm_visiParams(sat_radius,target_radius,type_par1,par1,type_par2)
       [res1,..resN]=CL_gm_visiParams(sat_radius,target_radius,type_par1,par1,[type1,..,typeN])
       [result]=CL_gm_visiParams(sat_radius,target_radius,type_par1,par1,'all')

## Description

- Computes various visibility parameters:

  - satellite's semi view-angle (sat): angle between the descending vertical and the direction of the target location

  - satellite's elevation (elev): elevation of the satellite as seen from the target location

  - satellite's incidence (incid = pi/2 - elev): incidence of the target-satellite direction from the target location

  - distance (dist): distance between the satellite and the target location

  - centre angle (cen): angle between the (planet centre -> satellite) direction and the (planet centre -> target location) direction.

  Given the distance from the planet centre to the satellite (sat_radius), the distance from the planet centre to the target (target_radius) and one of the following parameters (type_par1):

  type_par1 = 'sat' , par1 = satellite's semi view angle in radians.

  type_par1 = 'elev' , par1 = elevation from the target location in radians.

  type_par1 = 'incid' , par1 = incidence (=pi/2-elev) from the target location in radians.

  type_par1 = 'dist' , par1 = distance between the target location and the satellite in meters.

  type_par1 = 'cen' , par1 = centre angle: angle from the planet centre between the target location and the satellite in radians.

  The function computes par2 whose type is defined by type_par2

  type_par2 can also be an array of strings (any of the 5 parameters above), or 'all' and in that case the result is a structure whose fields are the 5 parameters above

- Notes:

  - A spherical planet is assumed.

  - If the input parameter is 'sat' there usually exist 2 possible solutions. But only the one for which the elevation is positive is computed.

## Parameters

sat_radius:

  Distance from the satellite to the planet centre (satellite altitude + planet radius) [m] (1xN)

target_radius:

  Distance from the target to the planet centre (target altitude + planet radius) [m] (1xN)

type_par1:

  (string) Type of input parameter par1. It can be 'sat', 'elev', 'incid', 'dist', 'cen'

par1:

  Satellite's semi view angle, elevation, indicence, distance or centre angle [rad,m] (1xN)

type_par2:

  (string) Type of ouput parameter(s) to be computed. It can be 'sat', 'elev', 'incid', 'dist', 'cen' or a vector contaning any of them, or 'all'. If type_par2 == 'all', a structure is returned.

par2:

  Computed value(s): [rad,m] (1xN)

## Authors

- CNES - DCT/SB

## Examples

    sat_r = %CL_eqRad + 700.e3; // 700 km altitude
    target_r = %CL_eqRad + 0; // Ground

    // Distance to Ground incidence:
    [incid]=CL_gm_visiParams(sat_r,target_r,'dist',800.e3,'incid')

    // Satellite view angle to Ground elevation:
    [elev]=CL_gm_visiParams(sat_r,target_r,'sat',CL_deg2rad(10),'elev')

    // Centre angle to distance:
    [dist]=CL_gm_visiParams(sat_r,target_r,'cen',CL_deg2rad(7),'dist')

    // Ground incidence to satellite view angle and distance:
    [sat,dist]=CL_gm_visiParams(sat_r,target_r,'incid',CL_deg2rad(15),['sat','dist'])

    // Satellite view angle to everything:
    [result]=CL_gm_visiParams(sat_r,target_r,'sat',CL_deg2rad(37),'all');