Code covered by the BSD License  

Highlights from
Angle calculator from sin and cos values

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 1.29 KB File ID: #42365

Angle calculator from sin and cos values

by

 

This function uniquely determines the angle (-180,180] in degree or(-pi, pi] in radian

| Watch this File

File Information
Description

This function uniquely determines the angle (-180,180] in degree or(-pi, pi] in radian from sine and cosine values.

Usage:
theta=angleCalc(S,C,out_mode)

S: sin value of the angle
C: cos value of the angle
out_mode: 'deg' OR 'rad'
the default output mode is in degree

Example:
 theta= angleCalc(sin(-2*pi/3),cos(-2*pi/3))
     theta = -120;
 theta= angleCalc(sin(2*pi/3),cos(2*pi/3),'rad')
     theta= 2.0944 [rad]

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
26 Jun 2013 James Tursa

There are already vectorized built-in functions for this, atan2 and atan2d. Your submission is not vectorized and is not as capable as the built-in functions. I would suggest removing your submission from the FEX.

Contact us