Help Luiz, Please..



#6

Having separated NE and 34.2345 from "N34.2345E" to get :
34.2345 "NE", I need a some more help.

I further need to do the following:

If NE then, leave as is;
if NW then NEG 360 HMS+;
if SW then 180 +;
if SE then NEG 180 +

How can I add all these clauses into one test clause. I am really having problems.

Actually, I am trying to write a program [with great difficulty] that converts quadrant bearings to Whole Circle bearings [ clockwise from north ].


#7

Rick,

I don't know what you are trying to do but the conversation is interesting and reminds me of things done many years ago. I also don't know if you are in control of your environment but the use of N34.2345E for a bearing is rather inconvenient. NE34.2345 is easier because you only make one transfer from the alphabetic keyboard to the numeric, and most surveyors would prefer using numeric codes for the quadrants where 1 is NE, 2 is SE, 3 is SW, and 4 is NW. If numeric quadrants are used then you never have to use anything but the numeric keypad. This can simplify this whole process quite a lot. Since bearings only have degrees up to 90 (two digits) then they can be expressed as Q.ddmmss, where Q is the quadrant number. The quadrant can then be separated by using the interger portion of the number and assigning it to a variable (Q=1). The remaining fractional part of the number can be multiplied by 100 to get the bearing numbers (B)as you have listed them (B=34.2345). The bearing numbers can then be modified through a series of tests (if Q=2 then B=180-B, if Q=3 then B=180+B, if Q=4 then B=360-B). Of course if Q=1 then you don't have to do anything. This will result in a north azimuth in degrees, minutes, seconds clockwise format.

I wouldn't do it quite like this because I would also want to do some checking for an illegal quadrant number. I would also have an if statement for Q=1 and in all cases would transfer to a different part of the program so that if Q was not equal to 1-4 then I would continue into an error blocking statement.

Of course you can use the built in conversion to decimal degrees (HR) or the HMS+ and HMS- if you are going to do calculations with the angles.

Again maybe you don't have any control over the format of the bearings being input, in which case the testing will have to be done on an alphabetic character match instead. If you have control over the input then you will find the numeric quadrants much faster and more accurate.

Best Regards and don't give up.

Forrest

#8

Hi, Rick; sorry taking too long (I just accessed www right now).

I remember dealing with Survey programs some time ago (about twelve years or more) and I am aware of what you want, I guess. There is a CASE structure that may be of help (any HP48 or HP49). The CASE is like this:

CASE
test1 THEN action if test1 is true END
test2 THEN action if test2 is true END
.
.
.
default action if no test is true (optional)
END
By using RPL and operations directly in stack contents is also easy, but demands a bit of "daring". So, using CASE, you can try this: (consider you have the resulting values from previous sequence, meaning number in level two and quadrant identifier in level 1)
.
.
.
-> QI
« CASE QI "NW" == THEN NEG 360 HMS+ END
QI "SW" == THEN 180 + END
QI "SE" == THEN NEG 180 HMS+ END
END QI
»

After this, you'll have the quadrant identifier back to level 1 and the correct bearing in level 2. If you want to discard the quadrant identifier, simply suppres the las QI (after the last END).

Hope this helps. In fact, I did not test it, I just wrote it in a rush to answer you. If it does not work, please, post again.

Cheers.

Luiz (Brazil)


Edited: 4 Jan 2005, 10:42 p.m.


#9

Thanks again Luiz. That's it as usual. Have a great day.


#10

Hi, Rick; I'm glad it fit your needs (so far).

I'll write a no CASE...END, stack-only solution later so you can compare.

BTW, if you need more help/advice and want an off-line discussion for your program, be my guest: lcvieira at quantica dot com dot br (this avoids some SPAM engines...). Later you can share it as a final solution. I'm not entirely "on vacations", but I'll find some time to program. In fact, it's a relaxation time...

Best regards.

Luiz (Brazil)


Possibly Related Threads...
Thread Author Replies Views Last Post
  Message to Luiz C. Viera Peter A. Gebhardt 2 376 02-27-2013, 09:27 AM
Last Post: Peter A. Gebhardt
  Does anyone have a copy of this keyset font PDF from Luiz? Gene Wright 6 710 04-23-2011, 12:34 PM
Last Post: gene wright
  Looking for Luiz Vieira! Gene Wright 0 256 02-23-2011, 10:04 AM
Last Post: gene wright
  Trying to contact Luiz C. Vieira Iqbal 6 620 02-06-2011, 03:26 AM
Last Post: Alejandro Paz (Germany)
  Msg to Vieira, Luiz C Jean-Michel 1 324 06-15-2010, 04:10 PM
Last Post: Vieira, Luiz C. (Brazil)
  To Luiz Vieira R Lion (Spain) 0 240 12-18-2009, 11:25 AM
Last Post: R Lion (Spain)
  Hi Luiz Michel Beaulieu 3 447 03-02-2007, 09:00 PM
Last Post: deleted
  To Luiz (HP-41 extended char set font) Gerson W. Barbosa 5 544 12-28-2005, 12:33 AM
Last Post: Vieira, Luiz C. (Brazil)
  Vieira, Luiz C. (Brazil) please help john littlefield 5 541 05-05-2005, 04:02 AM
Last Post: sqrt(2)
  Help on 42S ROM - Help Luiz! Artur 3 448 02-03-2005, 03:02 PM
Last Post: Erik Ehrling (Sweden)

Forum Jump: