Rspeed = radialspeed(Pos,V) returns
the radial speed of the given platforms relative to a reference platform.
The platforms have positions Pos and velocities V.
The reference platform is stationary and is located at the origin.

Rspeed = radialspeed(Pos,V,RefPos) specifies
the position of the reference platform.

Rspeed = radialspeed(Pos,V,RefPos,RefV) specifies
the velocity of the reference platform.

Input Arguments

Pos

Positions of platforms, specified as a 3-by-N matrix. Each column
specifies a position in the form [x; y; z],
in meters.

V

Velocities of platforms, specified as a 3-by-N matrix. Each
column specifies a velocity in the form [x; y; z],
in meters per second.

RefPos

Position of reference platform, specified as a 3-by-1 vector.
The vector has the form [x; y; z],
in meters.

Default: [0; 0; 0]

RefV

Velocity of reference platform, specified as a 3-by-1 vector.
The vector has the form [x; y; z],
in meters per second.

Default: [0; 0; 0]

Output Arguments

Rspeed

Radial speed in meters per second, as an N-by-1 vector. Each
number in the vector represents the radial speed of the corresponding
platform. Positive numbers indicate that the platform is approaching
the reference platform. Negative numbers indicate that the platform
is moving away from the reference platform.

Calculate the radial speed of a target relative
to a stationary platform. Assume the target is located at [20;
20; 0] meters and is moving with velocity [10;
10; 0] meters per second. The reference platform is located
at [1; 1; 0].