Post Reply 
a degree radians question....
10-20-2017, 11:19 PM
Post: #1
a degree radians question....
if i type 1<angle>30_deg, and my default angles are in radians, when I hit enter, it comes out as 1<angle>0.5325, converting to radians.
However, if in the geometry app, I enter point(1<angle>30_deg), it can't deal with it, whereas point(1<angle>0.5235) works fine.

Is there a fast way to convert from 1<angle>30_deg to radians (like enter does)....so it can be used in the point call?

I know I can cut and paste from the enter conversion....but I'm wondering why the point function doesn't understand the units and if there is an easier way to enter it as degrees when the default angle format is radians????????????

Thanks
-D
Find all posts by this user
Quote this message in a reply
10-21-2017, 01:15 AM
Post: #2
RE: a degree radians question....
I was able to use point(EXPR("1<angle>30_deg")) successfully....
Find all posts by this user
Quote this message in a reply
10-23-2017, 01:41 PM
Post: #3
RE: a degree radians question....
Hello,

Sorry, but this syntax is a Home "trick" and is not supported by the CAS.

there is a ged to rad in cas if I remember well, but I do not remember the exact function name.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
10-23-2017, 03:39 PM
Post: #4
RE: a degree radians question....
(10-23-2017 01:41 PM)cyrille de brébisson Wrote:  Hello,

Sorry, but this syntax is a Home "trick" and is not supported by the CAS.

there is a ged to rad in cas if I remember well, but I do not remember the exact function name.

Cyrille

Yes, and that is the crux. A dedicated <angle button> has been set up on the keyboard to handle a polar coordinate notation but the algebra is not implemented consistently and fully in Home and CAS. (There is even a degree button (° ‘ “) that could be used to distinctly separate the rad and degree units.

It’s a pity. Polar coordinates algebra and the ability to effortlessly move between Polar and Rectangular coordinates, degree and radians is one of the most used function on a calculator for engineering students. The frustrating thing is that the Prime have all functionality under the hood just not assigned to the <angel> button and only recognizes the polar <angel> notation in certain cases in Home.

It would be fantastic if HP could realize the value of the <angel> button by assigning this existing logic to it. While at it please allow the user to use the degree button (° ‘ “) to enter the angel in degrees explicitly e.g. 2<30°.

Imaging how much easier it would be to just type exactly (no more no less): 2<30° * 4<(π/4) * (1+2i) / (3 + 3i) (settings at radians) and then use < to shift between the Polar and Rectangular coordinates (Home does shifting with the < button but CAS doesn’t).
Find all posts by this user
Quote this message in a reply
10-23-2017, 05:05 PM (This post was last modified: 10-23-2017 05:06 PM by Tim Wessman.)
Post: #5
RE: a degree radians question....
Its nothing to do with lacking the understanding that it is important, nor in lacking the will to do so.

The CAS would need extensive modification and is inherently incompatible with the concept of angular values as implemented in Prime or previous calculators. There are plenty of things on the list to work on, would take an incredible amount of time and effort, and this is not higher then the others in priority.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
10-23-2017, 10:07 PM
Post: #6
RE: a degree radians question....
(10-23-2017 05:05 PM)Tim Wessman Wrote:  Its nothing to do with lacking the understanding that it is important, nor in lacking the will to do so.

The CAS would need extensive modification and is inherently incompatible with the concept of angular values as implemented in Prime or previous calculators. There are plenty of things on the list to work on, would take an incredible amount of time and effort, and this is not higher then the others in priority.

Since I have no access to the source code of Home or the keyboard I/O, lexical analyzer and parser, I cannot say how hard it is to do this and I can imagine it could be tricky, but since the functions are there in CAS and Home just not assigned to the <angle>/< ° ‘ “ > symbols and buttons nor recognized (consistently) by the parser, I imagined it could be relatively easy as well... at least I hoped so writing my suggestion before…

Anyway, naively, I would think it would just be:

In CAS: as the user types poll key board
a) if <angle> pressed and polar/rectangular coordinates are present, then invoke existing appropriate convert function (that already exist in CAS) and present result EXACT. If not, just allow the <angle> token
In CAS and Home: as the user types poll key board
b) if < ° ‘ “ > pressed, tokenize ° ‘ “ and the symbols/numbers between them (alternatively this can be done on <enter>)

For parsing a full line when the user presses <enter> key
1) Changing/adapting the lexical analyzer to recognize and tokenize the <angle> and the < ° ‘ “ > symbol (as well as the symbols/numbers around them) properly in the lexical context of the whole input line.
2) Adding/adapting the BNF/EBNF rules for how to syntactically interpret the statement around the <angle> and < ° ‘ “ >. Parse the whole line to produce the AST in a standard form that CAS or Home already can understand (depending on the view you are in). Since the actual algebra code is already there, it could be simple mapping to an AST form that is already understood (for CAS this could simply be rectangular form since CAS can handle rectangular form algebraically)
3) Invoking CAS or Home engine (passing the AST in the standard form). Wait for it to return…
4) When result return, you could choose to always show in rectangular form.
5) Return to allow user to use key board
6) Allow user to swap between the forms using a) above (home already working)
Probably I am too simplistic here making too many assumptions on the internals, but it looked straight forward to me…

Understand there must be many priorities HP need to balance, but still, this would be an important one, not only to Engineering students, but also to Pre calc, AP calc and AP physics high school students.

Thanks for reading
Find all posts by this user
Quote this message in a reply
10-23-2017, 10:20 PM (This post was last modified: 10-23-2017 10:22 PM by webmasterpdx.)
Post: #7
RE: a degree radians question....
I got it to work fine and created a useful function to convert that works great....
....as in here:
http://www.wiki4hp.com/doku.php?id=prime:polrec

-Donald
Find all posts by this user
Quote this message in a reply
10-23-2017, 10:44 PM
Post: #8
RE: a degree radians question....
(10-23-2017 10:20 PM)webmasterpdx Wrote:  I got it to work fine and created a useful function to convert that works great....
....as in here:
http://www.wiki4hp.com/doku.php?id=prime:polrec

-Donald

The point is to NATIVELY implement polar and rectangular algebra where <angle> and < ° ‘ “ > symbols/keys can be used in CAS and Home consistently without any code of our own.

I count at least 3 people independently developing and publishing polar/ rectangular conversion/algebraic functions in the HP Prime Software Library http://www.hpmuseum.org/forum/forum-15.html, basically addressing the same topic (using slightly different approaches...).

Anyway, the very fact that several people do this (and these are just the people that published), is in it self, evidence that there is a need to implement it NATIVELY in the calculator source code itself.
Find all posts by this user
Quote this message in a reply
10-24-2017, 01:30 AM
Post: #9
RE: a degree radians question....
Well, the wiki page I published was to show people how to work with polar/rect coords on the prime, so they don't have to figure it out from scratch again.....just get used to using the prime. I agree, it'd be nicer if it was built-in, but I can work with what's on the wiki quite comfortably.
The POLREC function on the wiki really should already exist in the firmware at least....that's just a matter of adding that function.
Maybe also adding a TOREC function that will give rect/complex output whether the input is rect or polar, and a TOPOL function to do the same with polar. This way, calls to point could be done like point(TOREC(V)) for example, and it won't matter if V is polar or rect. Just a suggestion.
-Donald
Find all posts by this user
Quote this message in a reply
10-24-2017, 06:57 AM
Post: #10
RE: a degree radians question....
I have implemented support for deg/rad/grad units in angle input:
geogebra svn 57285
Find all posts by this user
Quote this message in a reply
10-24-2017, 09:50 AM
Post: #11
RE: a degree radians question....
I can use the way it's currently implemented, but to do everything I'd typically want, I need to implement the functions I mentioned, and in addition deg and rad to convert from degree to radians and vice versa respectively. I think Tim is just saying since the device has the buttons, why not implement these functions using the degree and/or angle buttons.
Find all posts by this user
Quote this message in a reply
10-24-2017, 11:18 AM
Post: #12
RE: a degree radians question....
I am one of the people that Anders referred to.

I implemented a method to do the conversions for CAS view using the blue Define key. This way HP Prime Free - Lite users can use the functions. I agree with Anders that it would be nice to have bujilt-in versions for both HOME and CAS view.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)