First time here? Check out the FAQ!

Ask Your Question
1

Radian–degree conversion

asked 13 years ago

Eviatar Bach gravatar image

Hello,

It seems to be unnecessarily hard to numerically convert radians to degrees in Sage. For example, how does one convert arctan(4/5) radians to degrees?

The following

n(arctan(4/5))*sage.symbolic.units.convert(units.angles.radian,units.angles.degree)

returns

121.453369600239*degree/pi

Is there a simple way to just return a numerical answer (without multiplying by 180/pi)?

Preview: (hide)

Comments

What is wrong with multiplying by 180/pi ?

benjaminfjones gravatar imagebenjaminfjones ( 13 years ago )

I just wanted to see if it could be done with Sage's units module.

Eviatar Bach gravatar imageEviatar Bach ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 13 years ago

Mike Hansen gravatar image

There's currently no way in Sage to do something like:

sage: angle_measurements('degrees')
sage: sin(90)
1
sage: arcsin(1)
90

At the moment, your best best is to either manually multiply/divide by 180/pi or write wrapper functions for the trig functions which do the conversions for you.

Preview: (hide)
link

Comments

That's too bad. Thanks anyways!

Eviatar Bach gravatar imageEviatar Bach ( 13 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 6,351 times

Last updated: Jul 05 '11