Code covered by the BSD License

### Highlights from degrees and radians

4.63636
4.6 | 11 ratings Rate this file 17 Downloads (last 30 days) File Size: 1.55 KB File ID: #3263 Version: 1.1

### Richard Medlock (view profile)

13 Apr 2003 (Updated )

Two helper functions, one converts degrees to radians, the other rads to deg.

### Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

File Information
Description

Two simple functions to save time writing out the code to do a degrees to radians calculation or vice versa.

Acknowledgements

MATLAB release MATLAB 6.1 (R12.1)
29 Feb 2016 Abel Luis

### Abel Luis (view profile)

meu, você é o cara

20 Apr 2015 Nathan Birch

### Nathan Birch (view profile)

Exactly what I was looking for, thank you.

01 Nov 2011 Brato CHAKRABARTI

### Brato CHAKRABARTI (view profile)

Makes computation time longer. Very simple. Yet very useful at times.

19 May 2010 Jeff Gibson

### Jeff Gibson (view profile)

Good simple function. Any true programmer understands the importance of maintainability and code reuse from a software engineering perspective, espcially when the performance hit is infinitesimal.

19 Nov 2009 Richard Medlock

### Richard Medlock (view profile)

Duane - yes you are probably correct, the original calculation however was done differently and was shorter. However, the benefit for me personally is two fold - 1) it makes it easier to troubleshoot the code because it's more readable and 2) repetitive calculations are generally best kept as functions which enable you to more easily find and replace them, and avoid mistakes in typing out duplicate code. But everyone has their own preferred way of doing things.

Comment only
21 Aug 2009 Duane Hanselman

### Duane Hanselman (view profile)

How does this save time? Function calling overhead makes this computationally slower than direct multiplication. Typing the function call degrees(theta) is 14 keystrokes whereas 180/pi*theta is only 12 keystrokes. The same is true for typing radians(theta). So how does this save time?

Comment only
13 Aug 2009 Joel

### Joel (view profile)

Simple

15 Mar 2008 Carson Smith

Thanks

11 Jan 2008 Atul Kumar

good yar

18 Nov 2006 Seung-Bin Lim
29 Nov 2004 ezekiel calderon

if only i knew earlier how to install the file, i would be a lot easier.

05 Apr 2004 a a

thank you so much. you helped me out a whole lot.