The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

ATAN2 on 35S
Message #1 Posted by Vincze on 14 Aug 2007, 4:07 p.m.

Can the 35s perform the ATAN2 function as a built in function? I have not found it and I am in need of it.

      
Re: ATAN2 on 35S
Message #2 Posted by Gene Wright on 14 Aug 2007, 4:09 p.m.,
in response to message #1 by Vincze

Not as a built-in function.

You'll have to use several lines of code.

Edited: 14 Aug 2007, 4:35 p.m.

      
Re: ATAN2 on 35S
Message #3 Posted by Thomas Radtke on 14 Aug 2007, 4:12 p.m.,
in response to message #1 by Vincze

You could construct a komplex number x+iy and apply ARG. This is what I do in my R > P implementation.

            
Re: ATAN2 on 35S
Message #4 Posted by Vincze on 14 Aug 2007, 4:22 p.m.,
in response to message #3 by Thomas Radtke

I don't think I follow you. For example, if X = 10 and Y = 15, ATAN2 of those should be 0.982794.

So you say to do following in RPN:

i15 - ENTER - 
10
ARG
When I do that, it yield 56.309932. Am I not understanding something?
                  
Re: ATAN2 on 35S
Message #5 Posted by Thomas Radtke on 14 Aug 2007, 4:28 p.m.,
in response to message #4 by Vincze

Your calc is in DEG mode while you brain works in RAD ;-). Just do a ->RAD conversion.

                        
Re: ATAN2 on 35S
Message #6 Posted by Vincze on 14 Aug 2007, 4:33 p.m.,
in response to message #5 by Thomas Radtke

okay... that make sense.

                              
MOD on 35S
Message #7 Posted by Vincze on 14 Aug 2007, 4:47 p.m.,
in response to message #6 by Vincze

Sorry, but I have one more question. Can 35s do MOD (Modular arithmetic)? Such as a float be x and I solve for MOD(x,2*PI).

                                    
Re: MOD on 35S
Message #8 Posted by Thomas Radtke on 14 Aug 2007, 5:27 p.m.,
in response to message #7 by Vincze

I suppose you have the remainder in mind. Have a look at Chapter 4-2.

(INT menu, 3Rmdr)

                                          
Re: MOD on 35S
Message #9 Posted by Vincze on 14 Aug 2007, 5:33 p.m.,
in response to message #8 by Thomas Radtke

No, more like lets use simple clock example.

Let say start time is 20:00 on 24 hour clock, and you need to add 5 hours to that, but you wish to have wrap around math, so with normal math you state 20:00 + 5:00 = 25:00, but that does not make sense on clock. With modular math, you would say 20:00 + 5:00 mod 24 = 1:00, meaning if you start at 8pm, and you need to add 5 hours to it, you would finish at 1am. In Excel the formula would be =mod(Start + End, 24).

This used in aviation to work out degrees and the like.

I will look at chapter you state and see if that give me a clue

Edited: 14 Aug 2007, 5:35 p.m.

                                                
Re: MOD on 35S
Message #10 Posted by Thomas Radtke on 14 Aug 2007, 5:43 p.m.,
in response to message #9 by Vincze

That's just the usual modulo, same menu, 2INT/

                                                      
Re: MOD on 35S
Message #11 Posted by Vincze on 14 Aug 2007, 7:21 p.m.,
in response to message #10 by Thomas Radtke

That does not work. See for example. 20:00 + 12:00 mod 24 = 08:00

If I enter the following on calculator:

20
ENTER
12
+
24
INTG 2
answer is 1 which is not correct.

Time is easy to deal with, but when you dealing numbers that wrap around when reaching the modulus of 2 * PI, it a little harder to deal with. For calculation that I am doing, I need to simulate the Mod(x,y) function.

Edited: 14 Aug 2007, 7:48 p.m.

                                                            
Re: MOD on 35S
Message #12 Posted by Don Shepherd on 14 Aug 2007, 8:11 p.m.,
in response to message #11 by Vincze

It's INTG 3 (remainder)

                                                            
Re: MOD on 35S
Message #13 Posted by Vincze on 14 Aug 2007, 8:13 p.m.,
in response to message #11 by Vincze

I think I figure out, at least with clock.

Here is what I do. Let say we have 21:00 + 10:00 mod 24 = 07:00

35S work this way...

21 ENTER 10 + 24 / INTG 5 24 *

which yield 7.

I have to now try this on other calculation that use strange mod and see if this will be correct. I guess I could make short program that could do this.

Edited: 14 Aug 2007, 8:17 p.m.

                                                                  
Re: MOD on 35S
Message #14 Posted by Karl Schneider on 15 Aug 2007, 2:31 a.m.,
in response to message #13 by Vincze

Quote:
Let say we have 21:00 + 10:00 mod 24 = 07:00

The 35S works this way...

21
ENTER
10
+
24
INTG 3 (Rmdr)

which yields 7.

-- KS

                                                                        
Re: MOD on 35S
Message #15 Posted by Vincze on 15 Aug 2007, 9:16 a.m.,
in response to message #14 by Karl Schneider

Yes, that a few steps shorter than mine.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall