ATAN2 on 35S « Next Oldest | Next Newest »

 ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 04:07 PM Can the 35s perform the ATAN2 function as a built in function? I have not found it and I am in need of it. ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 08-14-2007, 04:09 PM Not as a built-in function. You'll have to use several lines of code. Edited: 14 Aug 2007, 4:35 p.m. Thomas Radtke Posting Freak Posts: 1,089 Threads: 32 Joined: Dec 2005 08-14-2007, 04:12 PM You could construct a komplex number x+iy and apply ARG. This is what I do in my R > P implementation. ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 04:22 PM 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? ▼ Thomas Radtke Posting Freak Posts: 1,089 Threads: 32 Joined: Dec 2005 08-14-2007, 04:28 PM Your calc is in DEG mode while you brain works in RAD ;-). Just do a ->RAD conversion. ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 04:33 PM okay... that make sense. ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 04:47 PM 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). ▼ Thomas Radtke Posting Freak Posts: 1,089 Threads: 32 Joined: Dec 2005 08-14-2007, 05:27 PM I suppose you have the remainder in mind. Have a look at Chapter 4-2. (INT menu, 3Rmdr) ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 05:33 PM 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. ▼ Thomas Radtke Posting Freak Posts: 1,089 Threads: 32 Joined: Dec 2005 08-14-2007, 05:43 PM That's just the usual modulo, same menu, 2INT/ ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 07:21 PM 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. ▼ Don Shepherd Posting Freak Posts: 1,392 Threads: 142 Joined: Jun 2007 08-14-2007, 08:11 PM It's INTG 3 (remainder) Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-14-2007, 08:13 PM 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. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 08-15-2007, 02:31 AM 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 ▼ Vincze Senior Member Posts: 376 Threads: 35 Joined: Jul 2007 08-15-2007, 09:16 AM Yes, that a few steps shorter than mine.

Forum Jump: