Post Reply 
HP Prime not Computing Correctly
12-04-2022, 07:49 PM
Post: #1
HP Prime not Computing Correctly
Hello! I've got an HP Prime G2 Rev D, that Isn't computing Trig very well. It tells me that the cos(160) = -0.030602620786 and sin(Pie/2 rad) = 2.741213359212e-2.
If someone can help that would be Appreciated.
Find all posts by this user
Quote this message in a reply
12-05-2022, 03:43 PM
Post: #2
RE: HP Prime not Computing Correctly
I am not sure about the COS(160), but the sin(pi/2) answer is what you get if the angle mode is set to degrees.

If your angle mode indicator is out of sync, you may need to reset your calculator.

Can you send a screenshot of the calculation?
Find all posts by this user
Quote this message in a reply
02-23-2023, 04:44 AM
Post: #3
RE: HP Prime not Computing Correctly
Was unable to get your result for cos 160 with the angle measure set to deg, rad, or grads. Like Keith said, your result for sin pi/2 is indicative of your angle measure being set to degrees. Set it to radians and you should get the expected result of 1.

Ensure your angle measure is set to degrees, and you should get -.93969 for cos 160.

Best regards, Hal
Find all posts by this user
Quote this message in a reply
02-23-2023, 03:09 PM
Post: #4
RE: HP Prime not Computing Correctly
One could argue that when the mode is set to degrees, pi should yield 180; as I can't really think of any circumstances when it would be preferentially yield otherwise, and thereby its value would be self-consistent with the angular measurement mode specified (and thereby help prevent inconsistent/unexpected results).
Find all posts by this user
Quote this message in a reply
02-23-2023, 03:24 PM
Post: #5
RE: HP Prime not Computing Correctly
(02-23-2023 03:09 PM)pschlie Wrote:  One could argue that when the mode is set to degrees, pi should yield 180; as I can't really think of any circumstances when it would be preferentially yield otherwise, and thereby its value would be self-consistent with the angular measurement mode specified (and thereby help prevent inconsistent/unexpected results).
Try calculating the circumference or area of a circle, then..
W.

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-23-2023, 03:31 PM
Post: #6
RE: HP Prime not Computing Correctly
Not to mention:
https://math.stackexchange.com/questions...ions-of-pi
Find all posts by this user
Quote this message in a reply
02-23-2023, 03:36 PM
Post: #7
RE: HP Prime not Computing Correctly
And how could I forget Euler's identity:
-1 = e^(i* pi)

On my HP71 with pi = pi I get:
-1 + i-2.067...e-13

with pi = 180:
-.598..+i-.8011...
Find all posts by this user
Quote this message in a reply
02-23-2023, 05:18 PM
Post: #8
RE: HP Prime not Computing Correctly
Sorry to keep replying, but I believe the second issue in the OP is that he expected (pi/2 rad) to override the degrees setting with the units tag. Since units are barely incorporated in the prime, I am not surprised that it does not work.
Find all posts by this user
Quote this message in a reply
02-23-2023, 06:01 PM (This post was last modified: 02-26-2023 12:59 PM by pschlie.)
Post: #9
RE: HP Prime not Computing Correctly
I guess I simply believes that when wishing to presume angles are expressed in degrees, then select degrees (which in-turn equates pi = 180, with trig functions similarly assuming degree operands); when wishing to presume angles are expressed in radians (which includes the formula A = pi*r^2 to calculate the area of a circle; and -1 = e^(i* pi) for example, with trig functions similarly assuming radian operands), then select radians as the preferred angular mode (which in-turn equates pi = 3.14...); I don't really see a problem, or anything which would be unexpected; pi is an angular value (except when it's not, so I now stand corrected and believe it's best to preserve it's symbolic presence until wishing to force it to a numerical value, at which time it should be considered to have a value of 3.14..).

However recognizing it would be nice if Euler’s identity for example could be computed consistently, regardless of the chosen preferred representation of angles:

e^(2*pi*i) = cos(2*pi) + i*sin(2*pi) = 1

It may simply be preferable for pi to retain its symbolic representation until applied as an argument, regardless of mode chosen for angular representation, and regardless of whether computing in symbolic or home mode.

Not perfect, but likely better than not:

cos(2*pi) => 1 (regardless of angular mode)
i*sin(2*pi) => 0 (regardless of angular mode)
e^(2*pi*i) => 1 (regardless of angular mode)
2*pi => 2*pi (regardless of angular mode)
~2*pi => 6.28.. (regardless of angular mode)
cos(360) => 1 (if mode=deg)
cos(360) => -0.283... (if mode=rad)
cos(6.28..) => 0.993.. (if mode=deg)
cos(6.28..) => 1 (if mode=rad)
Find all posts by this user
Quote this message in a reply
02-24-2023, 05:58 PM (This post was last modified: 02-24-2023 05:58 PM by ijabbott.)
Post: #10
RE: HP Prime not Computing Correctly
Personally, I would prefer it if the argument of the normal trig functions were always in radians, and there were separate trig functions (e.g. sind(x), cosd(x), tand(x)) for angles in degrees. The angle mode setting would then just determine which functions the keys map to by default. (I'm not sure how arguments with attached angle units should then be handled when used with the wrong trig functions though.)

— Ian Abbott
Find all posts by this user
Quote this message in a reply
02-25-2023, 04:15 PM
Post: #11
RE: HP Prime not Computing Correctly
(02-23-2023 06:01 PM)pschlie Wrote:  I guess I simply believe that when wishing to presume angles are expressed in degrees, then select degrees (which in-turn equates pi = 180, with trig functions similarly assuming degree operands); when wishing to presume angles are expressed in radians (which includes the formula A = pi*r^2 to calculate the area of a circle; and -1 = e^(i* pi) for example, with trig functions similarly assuming radian operands), then select radians as the preferred angular mode (which in-turn equates pi = 3.14...); I don't really see a problem, or anything which would be unexpected; pi is an angular value.

I don't agree that the formulae \(A = \pi r^2\) (or \(C = \pi d\)) assume anything about angular units. In the first, \(\pi\) is the ratio of two areas; in the second, \(\pi\) is the ratio of two lengths. I'm sure you know that values for \(\pi\) slightly greater than 3 go back to antiquity; radians, I believe, only go back 200-300 years. You could argue, if you wished, that circular area should be measured in different units than "square" area, and circular length in different units than "straight" length, but I'm not sure why you would wish to do this.

Perhaps I'm misunderstanding what you are suggesting. I can see why setting (for example) \(\sin\pi = 0\), etc., if \(\pi\) is expressed symbolically, might be useful. No-one has any business to be calculating the sine of pi degrees! But angular modes would still be needed, and perhaps it is least confusing to leave things as they normally are?

Nigel (UK)
Find all posts by this user
Quote this message in a reply
02-25-2023, 05:26 PM (This post was last modified: 02-26-2023 11:56 AM by pschlie.)
Post: #12
RE: HP Prime not Computing Correctly
(02-25-2023 04:15 PM)Nigel (UK) Wrote:  don't agree that the formulae \(A = \pi r^2\) (or \(C = \pi d\)) assume anything about angular units. In the first, \(\pi\) is the ratio of two areas;

Please see:

https://math.stackexchange.com/questions...f-a-circle

(The area of a circle can the thought of as the sum of an infinite number of triangles with two of its sides equal to the radius of the circle, with the third representing an infinitely small segment of the circumference of the circle integrated from 0 to 2*pi as the angular variable of integration; similarly pi is an angular value which corresponds to the length of the arc traversing across 1/2 the circumference of a unit (r=1) circle; arcs are measured in terms of its distance (radius) from some point, and an angular extent, which together defines some fraction of a circle's circumference having said radius; where for a unit circle, the angular values is defined to be equivalent to the length of the arc it projects, i.e. that's how the angular value of radians is defined. But do agree that the presence of pi in a computed value doesn't mean its an angular value, but it does imply it was alternatively likely derived from angular integration, just as C= 2*pi*r and A = 2*pi*(r^2)/2 are.)

As a somewhat related aside:

https://tauday.com/tau-manifesto

And in further conclusion, upon a bit more thought; if HP/Moravia ever considers refining the Prime; and if it was considered feasible to preserve the symbolic representation of pi in intermediate calculations, including Home mode; then the existence of pi in an intermediate expression could be use to imply the value of that expression is in radians (as most such expressions would naturally when specified as some fraction of pi); and in its absence, degrees or a dimensionless value can be presumed.

Similarly based on the angular mode specified, inverse trigonometric functions can represent their results as a fraction of pi if radians is preferred, or degrees otherwise. I.e:

cos(pi) => -1 (regardless of mode, pi implies radians)
cos(180) => -1 (regardless of mode, absence of pi implies degrees)

acos(-1) => pi (if mode = rad)
acos(-1) => 180 (if mode = deg)

cos(acos(-1)) => -1 (regardless of mode)

acos(cos(pi)) => pi (if mode = rad)
acos(cos(pi)) => 180 (if mode = deg)
acos(cos(180)) => pi (if mode = rad)
acos(cos(180)) => 180 (if mode = deg)

As just a thought/wish, along with a hope the same refinements would be supported in RPN mode.
Find all posts by this user
Quote this message in a reply
02-26-2023, 02:50 PM
Post: #13
RE: HP Prime not Computing Correctly
Thanks for the link! But you can work out the area of a circle by integrating from \(0^\circ\) to \(360^\circ\) if you adjust the arc length formula appropriately for degrees. Wikipedia tells me that radian measure probably originated in the 17th or early 18th century (AD). Almost 2000 years before that, Archimedes found that the area of a circle of unit radius lies between 223/71 and 22/7 (again from Wikipedia). He wasn't using radians.

More simply, just draw a circle on squared paper and count the squares. No choice of angle measure needed! I'm sure you're not arguing with this.

So: should \(\pi\) in the argument of a trig function mean that it should be interpreted as radians? Maybe. However, the absence of \(\pi\) certainly doesn't exclude radians. An angle might be estimated by the ratio of two lengths; \(\pi\) won't appear then. Or in an expression like \(\sin(kx-\omega t)\), with numerical values for wave number \(k\) and angular frequency \(\omega\), there is again no \(\pi\).

I think it would be better for the calculator to say "There's a \(\pi\) in your expression - do you want to change to radian mode?" when it notices this, rather than doing it silently. Or, if you asked for \(\sin(160)\) in radian mode, it could say "That's a rather large argument - do you want to change to degree mode?". Might be useful for students, and could be turned off if annoying!

Nigel (UK)
Find all posts by this user
Quote this message in a reply
02-27-2023, 12:26 PM (This post was last modified: 02-28-2023 11:41 AM by pschlie.)
Post: #14
RE: HP Prime not Computing Correctly
(02-26-2023 02:50 PM)Nigel (UK) Wrote:  ... Archimedes found that the area of a circle of unit radius lies between 223/71 and 22/7 (again from Wikipedia). He wasn't using radians.

Being also before the advent of calculus ...

I guess it is somewhat arbitrary how one prefers to specify angular values; radians could have been defined as the angular value circumscribing a circle having an extent between 0 and 1; but suspect defining it as having the same value as the length of the arc it corresponds to, divided by its radius, is a likely a bit more useful. I further agree that defaulting to an assumption of degree angular measurement absent presence of pi, is not likely a good idea; What's ideal? I guess it's largely a matter of personal preference, and typical use. (Maybe it's degree values which should be explicitly identified as such, and all else presumed to be otherwise?)
Find all posts by this user
Quote this message in a reply
03-11-2023, 04:25 PM
Post: #15
RE: HP Prime not Computing Correctly
A relevant xkcd:
https://xkcd.com/2748/
Find all posts by this user
Quote this message in a reply
Post Reply 




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