Contenuto principale

aer

R2026b

Calculate azimuth angle, elevation angle, and range of one asset with respect to another

    Description

    az = aer(asset,target) returns the history of azimuth angles, az, in degrees of the assets in target with respect to those in asset.

    [az,el] = aer(asset,target) returns the history of azimuth angles, az, and elevation angles, el, in degrees of the assets in target with respect to those in asset.

    example

    [az,el,range] = aer(asset,target) returns the history of azimuth angles, az, and elevation angles, el, and range (distance), range, of the assets in target with respect to those in asset. az and el are in degrees and range is in meters.

    example

    [az,el,range,timeOut] = aer(asset,target) additionally returns the times, timeOut, that correspond to az, el, and range. timeOut is specified as datetime with Coordinated Universal Time (UTC) time zone.

    [___] = aer(asset,target,timeIn) returns the azimuth angle, elevation angle, and range at the specified datetime timeIn.

    [___] = aer(___,Name=Value) returns the azimuth angle, elevation angle, range, and time using additional parameters specified by one or more name-value arguments.

    Examples

    collapse all

    Create a satellite scenario object.

    startTime = datetime(2021,4,25);                      % April 25, 2021, 12:00 AM UTC
    stopTime = datetime(2021,4,26);                       % April 26, 2021, 12:00 AM UTC
    sampleTime = 60;                                      % seconds
    sc = satelliteScenario(startTime,stopTime,sampleTime);

    Add a satellite to the scenario.

    tleFile = "eccentricOrbitSatellite.tle";
    sat = satellite(sc,tleFile);

    Add a ground station to the scenario using default properties.

    gs = groundStation(sc);

    Determine the azimuth angle, elevation angle, and range of the ground station with respect to the satellite at April 25, 2021, 1:26 AM UTC.

    time = datetime(2021,4,25,1,26,0);
    [azimuth,elevation,range] = aer(sat,gs,time)
    azimuth = 
    12.3293
    
    elevation = 
    -68.1798
    
    range = 
    1.2784e+07
    

    Create a satellite scenario object.

    startTime = datetime(2023,4,25);                      % April 25, 2023, 12:00 AM UTC
    stopTime = datetime(2023,4,26);                       % April 26, 2023, 12:00 AM UTC
    sampleTime = 60;                                      % seconds
    sc = satelliteScenario(startTime,stopTime,sampleTime);

    Add a satellite to the scenario.

    tleFile = "eccentricOrbitSatellite.tle";
    sat = satellite(sc,tleFile);

    Add a platform to the scenario.

    trajectory = geoTrajectory([40.6413,-73.7781,10600;32.3634,-64.7053,10600],[0,2*3600],AutoPitch=true,AutoBank=true);
    pltf = platform(sc,trajectory);

    Determine the azimuth angle, elevation angle, and range of the platform with respect to the satellite at April 25, 2023, 1:26 AM UTC.

    time = datetime(2023,4,25,1,26,0);
    [azimuth,elevation,range] = aer(sat,pltf,time)
    azimuth = 
    2.6782
    
    elevation = 
    -81.3176
    
    range = 
    4.1501e+07
    

    Input Arguments

    collapse all

    First scenario component, specified as a Satellite, GroundStation, ConicalSensor, Gimbal, Platform, Transmitter, or a Receiver object.

    Second scenario component, specified as a Satellite, GroundStation, ConicalSensor, Gimbal, Platform, Transmitter, or a Receiver object.

    Time at which output is calculated, specified as a datetime. If no time zone is specified in timeIn, the time zone is assumed to be UTC.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: LineWidth=2.5 sets the line width of the link to 2.5 pixels.

    Coordinate frame in which az and el are reported, specified as one of these values:

    • "ned"az and el are reported in the North-East-Down (NED) frame on the reference celestial body specified by ReferenceCelestialBody and centered at asset. The x-axis of this frame points North, y-axis points East, and z-axis points down.

    • "body"az and el are defined in the body frame of asset.

    The default value is "ned".

    Since R2026b

    Celestial body with respect to which the North-East-Down (NED) frame is defined, specified as "Earth" or "Moon". ReferenceCelestialBody is ignored if CoordinateFrame equals "body". The default value is the value specified by the CentralBody property of asset.

    Data Types: string

    Output Arguments

    collapse all

    1-by-n row vector or m-by-n array of azimuth angles of target with respect to asset in degrees, where n is the number of time samples.

    • If both asset and target are scalars, az is a 1-by-n row vector, where each element represents the azimuth angle of target with respect to asset at a specific time sample.

    • If asset is a scalar and target is a vector, az is an m-by-n array, where each row index represents the azimuth angle of the corresponding element in the index location in target with respect to asset. The columns represent the time samples.

    • If asset is a vector and target is a scalar, az is an m-by-n array, where each row index represents the azimuth angle of target with respect to the element at the corresponding index location in asset. The columns represent the time samples.

    • If both asset and target are vectors, the length of asset and target must be equal. az is an m-by-n array, where each row index corresponds to the index in asset and target, and represents the azimuth angle of the element at the index in target with respect to the element at the index in asset. The columns represent the time samples.

    If timeIn input is specified, n equals 1 and az represents the azimuth angle at the specified time timeIn. If AutoSimulate property of the satellite scenario is true, az represents the azimuth angle history from StartTime to StopTime. If AutoSimulate property of the satellite scenario is false, az represents the azimuth angle history from StartTime to SimulationTime property.

    In a coordinate frame, az is calculated by first projecting the position vector of target with respect to asset on the x-y plane. The angle between this projection and the x-axis of the coordinate frame is the azimuth angle.

    1-by-n row vector or m-by-n array of elevation angles of target with respect to asset in degrees, where n is the number of time samples.

    • If both asset and target are scalars, el is a 1-by-n row vector, where each element represents the elevation angle of target with respect to asset at a specific time sample.

    • If asset is a scalar and target is a vector, el is an m-by-n array, where each row index represents the elevation angle of the corresponding element in the index location in target with respect to asset. The columns represent the time samples.

    • If asset is a vector and target is a scalar, el is an m-by-n array, where each row index represents the elevation angle of target with respect to the element at the corresponding index location in asset. The columns represent the time samples.

    • If both asset and target are vectors, the length of asset and target must be equal. el is an m-by-n array, where each row index corresponds to the index in asset and target, and represents the elevation angle of the element at the index in target with respect to the element at the index in asset. The columns represent the time samples.

    If timeIn input is specified, n equals 1 and el represents the elevation angle at the specified time timeIn. If AutoSimulate property of the satellite scenario is true, el represents the elevation angle history from StartTime to StopTime. If AutoSimulate property of the satellite scenario is false, el represents the elevation angle history from StartTime to SimulationTime property.

    In a coordinate frame, el is the angle between the position vector of target with respect to asset and the x-y plane.

    1-by-n row vector or m-by-n array of range (distance) of target with respect to asset in meters, where n is the number of time samples.

    • If both asset and target are scalars, range is a 1-by-n row vector, where each element represents the range of target with respect to asset at a specific time sample.

    • If asset is a scalar and target is a vector, range is an m-by-n array, where each row index represents the range of the corresponding element in the index location in target with respect to asset. The columns represent the time samples.

    • If asset is a vector and target is a scalar, range is an m-by-n array, where each row index represents the range of target with respect to the element at the corresponding index location in asset. The columns represent the time samples.

    • If both asset and target are vectors, the length of asset and target must be equal. range is an m-by-n array, where each row index corresponds to the index in asset and target, and represents the range of the element at the index in target with respect to the element at the index in asset. The columns represent the time samples.

    If timeIn is specified, n equals 1.

    Time that correspond to the samples of az, el, and range, specified as datetime with UTC time zone. If timeIn input is specified, timeOut is a scalar. If timeIn input is not specified, timeOut is an n-element row vector, where n is the number of time samples.

    Version History

    Introduced in R2021a

    expand all