Code covered by the BSD License

### Highlights from Polar/cartesian into degree north reference

1.0
1.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 1.85 KB File ID: #23441 Version: 1.0

# Polar/cartesian into degree north reference

### Arnaud Laurent (view profile)

Set of function to convert polar/cartesian coordinates into degrees north and inversely.

File Information
Description

This set of function change from polar or cartesian coordinates into degrees with north reference. It also change degrees north into cartesian or polar coordinates. This is useful when working with velocity vector, e.g. current, wind.
The functions work with single values or with vectors.

The zip file contain:

- compass2pol.m: change degree north into polar coordinates.
- compass2cart.m: change degree north and velocity into u and v (cartesian coordinates).
- cart2compass.m: change u and v (cartesian coordinates) into degree north and velocity.
- pol2compass.m: change polar coordinates into degree north.

MATLAB release MATLAB 7.5 (R2007b)
17 Feb 2016 Bastien Queste

### Bastien Queste (view profile)

31 Aug 2012 janez

### janez (view profile)

cart2compass engine can be simplified - you don't need three 'find'-s.

degN: angle in degree north system (N = 0 degrees, E = 90 degrees)
deg: cartesian angle (E = 0 degrees, N = 90 degrees)

then it follows:

degN = 90 - deg;
idx = find(degN < 0);
degN(idx) = degN(idx) + 360;

output:
deg =

0 45 90 135 180 225 270 315 360

degN =

90 45 0 315 270 225 180 135 90

regards!

Comment only