• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended

Tim-

 

Thank you for showing how to enter polar complexes using numerals.  

 

But I'm still puzzled when, in PPL--not home--I set out to combine two scalar VARIABLES into a polar complex.  Here's what I would expect is possible, but it results in a syntax error:

EXPORT TestPolar()
BEGIN
  LOCAL A,B,Z;
  A:=1;
  B:=45;
  Z:=(A,∡B);   // <----Syntax error here.
RETURN(Z);
END;

 

 

So, the only thing I can do is a workaround using rectangular_coordinates(), or similarly using A*SIN(B) and A*COS(B):

 

EXPORT TestPolar2()
BEGIN
  LOCAL A,B,Z1,Z2;
  A:=1;
  B:=45;
  Z1:=rectangular_coordinates(A,B);
  Z2:=(Z1(1),Z1(2));
  RETURN(Z2);
END;

 

So, it seems, there is no direct way in PPL to create a polar complex the way one can a rectangular complex.  Is that the right conclusion?

 

Thanks,

Doug

 

HP Recommended

Hi!, dorbitbrown:

 

You can, other's program. See, this link ... http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=254617

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

Maké-

 

Thanks for the HP museum link.  I had seen it before, and it does not answer the question for two reasons.  

 

First, most simply, in the final message, the OP resorts to using rectangular_coordinates() and polar_coordinates() because there is no solution.

 

Second, in post #1, the OP's approach does not actually do what he wants, because  the line 

CTOT:=(CRP,CIP);

does not work the way he thinks in the program Rect_to_Polar().  For example, if you try:

Rect_to_Polar(1,1)

the result is 

1.41421356237+45*i

Which is actually

45.022216738∡88.1999598175

NOT the correct answer of

1.41421356237∡45

 

So, it seems, there is still no direct way in PPL to create a polar complex the way one can a rectangular complex.  Do you agree that the right conclusion?

 

Thanks,

Doug

 

HP Recommended

Hi!, dorbitbrown:

 

You should set, as ...

 

Rect_to_Polar.JPGRect_to_Polar_1.JPG

 

Rect_to_Polar_2.JPG

 

 

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

Make

 

Your last posting was unreadable in Chrome, IE, and Firefox.   All I could see were placeholders.  Please try re-posting with plain text.

 

Thanks,

Doug

HP Recommended

Hi!, dorbitbrown:

 

Ok. Your must configure, as ... 

 

In Home (Shift Settings)

Angle Measure : Degrees

Number Format : Fixed 4

Complex : (a,b) checked.

 

Now, press Tool Box key. Then, press User. In Program Funcion, select Rect_to_Polar.

 

In Cas or Home, you must see ...

Rect_to_Polar(1.0000,1.0000)

If press Enter, you see ... (1.4142,45.0000)

 

Rect_to_Polar.JPGRect_to_Polar_1.JPG

 

Rect_to_Polar_2.JPG

 

 

 

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

I see what you are having issues with. Does appear to be the correct conclusion for the moment. I'll would not have expected that to be the case and I will see what can be done...

 

I think this may be tied in with the way the parser/evaluator works though, so it might not be an easy adjustment/fix.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

Make-

 

Thank you for joining me in working on this tricky problem.

 

Please try taking ARG() of your result; you will be surprised to see that it is 88.2 degrees, NOT the 45 degrees you expected!!  However, to get 45, you could take IM() of your result, which is an important clue to what is going on.

 

Here is what has happened: when you switched the complex display from a+b*i to (A,B), it stopped displaying the "i", and so you were fooled into thinking that the number 45 represents degrees.  Actually, it represents the magnitude of the imaginary part of the complex number 1.4142+45.0000*i .  Another experiment you can try is this: with complex mode set to (A,B) enter (1∡45) and notice that it will be represented as (1∡45), and NOT as (1,45).

 

Thanks,

Doug

 

 

HP Recommended

Tim

 

Thank you very much for looking into this and recognizing what's going on.  I'll be interested to learn what you find out.  In the meantime, I'll use a workaround.

 

On a related topic (see my latest reply to Make's post for the motivation), would you happen to know if there is a user-accessible Settings variable that controls complex number display format?  HComplex controls the checkbox allowing complex results from real inputs, but I can't find anything to control the choice of " a+b*i" versus "(a,b)" format.  Hopefully I just overlooked it.

 

Thanks again,

Doug

HP Recommended

Hi!, dorbitbrown:

 

Ok. If you consider, that this result, is not adequate, use directly, the values of theory, indicated ...

Rect_Polar.JPG

Where ...

r = sqrt(x^2+y^2); theta = atan(y,x)

 

Too ...

-19*e^i*pi Enter [angle] --> (59.6093 angle -122.7042)

(1,1) Enter [angle] --> (1.4142 angle 45.0000)

 

 

 

 

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.