TangVelGPS.nb

Written by Vince Cronin
Begun March 14, 2021

Introduction

The purpose of this code is to determine the speed and azimuth of the instantaneous angular velocity of a GPS site, based on its north velocity (south velocities are negative) and east velocity (west velocities are negative).

Input

The input parameters are the magnitude of the east velocity vector and the magnitude of the north velocity vector, both expressed in mm/yr.

eastVelocity=-19.45;

northVelocity=21.95;

User-Defined Module

tangVelGPS[eastVel_,northVel_]:=Module[{totalVelocity,theta,azimuth,answer},totalVelocity=(Sqrt[(eastVelocity^2)+(northVelocity^2)]);theta=ArcTan[northVelocity/eastVelocity](180/π);azimuth=If[(eastVelocity<0),270-theta,90-theta];
answer={totalVelocity,azimuth};answer];

Computation

“Longhand” Version

The variable totalVelocity is the magnitude (speed) of the tangential velocity vector in mm/yr

totalVelocity=(Sqrt[(eastVelocity^2)+(northVelocity^2)]);

In a right triangle whose sides are the east velocity and the west velocity, respectively, the interior angle opposite the north velocity is theta.

theta=ArcTan[northVelocity/eastVelocity](180/π);

The variable azimuth is the azimuth of the tangential velocity vector in degrees measured clockwise from north

azimuth=If[(eastVelocity<0),270-theta,90-theta];

The variable answer1 is a list of two numbers.  The first number is the magnitude (speed) of the tangential velocity vector in mm/yr and the second number is the azimuth of the tangential velocity vector in degrees measured clockwise from north

answer1={totalVelocity,azimuth};

Computed Using Module

The variable answer2 is a list of two numbers.  The first number is the magnitude (speed) of the tangential velocity vector in mm/yr and the second number is the azimuth of the tangential velocity vector in degrees measured clockwise from north

answer2=tangVelGPS[eastVelocity,northVelocity];

Output

Computed “Longhand”

Magnitude (speed) of the tangential velocity vector in mm/yr

N[answer1[[1]]]

Azimuth (degrees measured clockwise from north)

N[answer1[[2]]]

Computed Using Module

Magnitude (speed)  of the tangential velocity vector in mm/yr

N[answer2[[1]]]

Azimuth (degrees measured clockwise from north)

N[answer2[[2]]]