any body have any formula for calculate the bearing between two coordinates.
You need to be a member of Land Surveyors United - Surveying Education Community to add thoughts!
any body have any formula for calculate the bearing between two coordinates.
You need to be a member of Land Surveyors United - Surveying Education Community to add thoughts!
Add Posts, Surveying Photos, Videos and Articles to the Surveyor Community
Add Stuff to Community
We are committed to allowing freedom of expression for all of our members, and that includes maintaining a safe space for people with opposing views to express themselves. We get posts from all over the country and even the globe, so needless to say, people come with different viewpoints on lad surveying practices and processes. We see this diversity and variety as a real strength-- dialogue and debate are an integral part of the educational process, as well as an important tool in exploring different sides of complex issues.
Replies
Hi Everyone, Though i was done, I still got plenty more, Sabaretnam, I guest your Question got answered, if only from me, But here is another program to go alone with all the rest. This one is by Mr. Harris, this is a very unique program, It uses -1 and 1 as a program pointer as a choose -1 runs R<>P and 1 runs P<>R. I do not think it can be used in other programs because of this , but by itself it is Great.
HP 35s Program label, P
P001 LBL P
P002 x<> F ; parameter for determining R<>P vs P<>R
P003 CLx
P004 -1 ; less than zero (default) R<>P X in x, Y in y
P005 STOP ; give the operator a chance to change the parm use [+/-] key
P006 x>0? ; branch around R<>P routine
P007 GTO P023
P008 x<> F
P009 STO X ; Entry Point for R<>P routine
P010 x^2 ; compute R value to be placed in y Y
P011 x<>y
P012 STO Y
P013 x^2
P014 +
P015 |x ; use square root key
P016 STO R ; save R to R
P017 RCL Y ; compute theta , R is lifted to y
P018 RCL X ;
P019 /
P020 ATAN
P021 STO A ; save theta in A (P y holds R, x holds theta
P022 RTN ; END R<>P routine
P023 x<> F ; Entry Point P<>R routine
P024 x<>y ; might have been able to use REGx REGy here...
P025 STO R ; save R from y
P026 x<>y ;
P027 STO A ; Save A (theta) from x
P028 SIN
P029 * ; multiply compute y
P030 STO Y
P031 RCL R ;
P032 RCL A ;
P033 COS
P034 * ; multiply compute x
P035 STO X
P036 RTN ; END P<>R routine y holds Y, x holds X
LN=110 CK=0E3B
I like this program by itself. You probable do not know how to use these ,write down or copy, you never know , you may buy a HP 35s , think how you could learn how to do this. It is something to think about.
Hi Everyone ,I bet you though that i had run out of them again,no way,I have many more here is one more, and more complicated than the one i gave above. But this Jason Foose calls, TRUE Polar to Rectangular conversion,Like i said ,you could start a contest on Programs and equations to do this.
(( SIN ( REGX ) x REGY ) x( 1 Θ 90 )) + (( COS (REGX ) x REGY ) x ( 1 i 0 ))
Here is also the link to this Blog.
http://rls43185.blogspot.com/2014/07/true-polar-rectangular-for-hp-...
I had to quit, before i could finish the Reply, so here goes .After you have ENTER, the equations, exit then input 5, ENTER, 53.13, then open EQN,,make sure your on that equation line, then press ENTER key, your answer= 3.0000 i 4.0000, now to go back to R to P, While, 3.0000 i 4.0000 is in screen or input 3.0000 i 4.0000,then ENTER if you like, then RT.shift ABS =5.0000, then same thing Roll down ↕ , 3.0000 i 4.0000 ,ENTER if you like,then LT. shift ARG = 53.1300 and this is one more way this is done. The Hp 35s is a very powerful tool for surveying, and long live RPN calculator
Hi Everyone, I bet you thought that i had run out ways to do this , well i haven't, in fact i have many more.But here is just one more.first Rectangular to polar, vice versa ,however you want to write it ,R→P, P→R, →Θ,r , → y,x , X i Y, r Θ a , is more of a part of the routine of B= ATAN( D ÷ L ) and √ ( a² + b² ) just a different way of doing it.Simple is always Gold when you find it.I have already showed how to do this on the HP 50G as BRG,,◄◄ d l / ATAN ►► and DIST,, ◄◄dsq lsq + √ ►► ,Now here is one more way HP 50G RTP,,◄◄ DUP ARG SWAP ABS ►► name it RTP
Now here is PTR ,,◄◄ DUP DUP RE SWAP IM SIN * SWAP DUP RE SWAP IM COS * ►► name it PTR, Now how they work, EX.RTP=(3,4) Enter if you like, or press PTR 5 in level 1 and 53.1301 level 2. Now PTR (5,53.1301) Enter if you like or press PTR, 3 in level 1 and 4 in level 2. And that is just one more way.
Hi Everyone ,I did see above where i left out, reversal of equations and programs to to RPL,
BRG and DIST,so to go along with these,◄◄ d L / ATAN ►► and ◄◄ dsq Lsq + √ ►►
I used Caps L just to make sure it was seen as a L, lower case is my intent. But now to reverse these two,If you have the Bearing and Distance which is Polar,to now go Rectangular.
LAT. = DIST. x COS BEARING, AND DEP, =DIST. x SIN BEARING
RPL program, ◄◄ d b SIN x ►►, name it lower case, dep
now for LAT., ◄◄ d b COS x ►►, name it lower case, lat
Now write a combine program and name it lower case pnr
Write like this ◄◄ d b SIN x , d b COS x►►, when you press ENTER the program
will not contain the coma , it will look like this◄◄ d b SIN x d b COS x ►►, then press Prime
and name it ' ' , ' pnr ' , sto , all you have to do is sto distance in d and bearing in b then press the vars dep, lat, or pnr that is three more programs. For the HP 50G.
Hi Everyone,Like i said there could be several ways to calculate a bearing or Azimuth from coordinates.I did not show my Inverse program in HPPPL, for the HP Prime,it is still a Beta so i am working on it.But back to the HP 35s,even though it does not have P→R or R→P or any other way , →Θ,r and →x,y that it, has been label on a calculator. It can be done like i said with programs or in display and complex mode.Lets do R→ P, First you would press left shift, Display [.] decimal 0,this sets the calculator in complex mode for R→P ,then key in 3 i 4,then ENTER,results in display are 5.0000Θ53.1301.
Now lets do P→R, left shift Display 9, this sets the calculator in complex mode for P→R,key in 5.0000, right shift theta, Θ 53.1301,then ENTER, result in display 3.0000 i 4.0000. That is one more way. And that is how the HP 35 s works .But It also can be done like this on a HP 50g,just (3.0000,4.0000) and you can use space in place of the coma,if you like,then ENTER,ENTER, then press left shift ABS,answer is 5.0000, then Delete,this drop (3.0000,4.0000) down on display, then right shift ARG ,answer 53.1301,that is one more way. This can also be done in complex soft keys on this calculator, and all the way back to the HP 48gx.
So not having these two keys is nothing new, when it comes to the HP 35s
Hi Everyone and Sabaretnam ,there are even more ways than i have already show you.here is some more.
First,some more equations.
First a Expression,This is a equation that does not have a equal sign =,
example : X^3+1 , that is a Expression, for a bearing you could write it like this.
ATAN (D / L ) We will solve on a RPN calculator. EQN,then Enter D? 3, R/S L? 4,R/S answer 36.8699
Next a Assignment, This equation contains a equal sign = and the left side has a single variable,
example A=0.5xbxh,this is a assignment,now for a bearing you could write it like this.
B = ATAN ( D ÷ L ) or B = ARG ( X+Y *i ) or B = ABS ( ATAN (D ÷ L ))
Run: EQN,solve B , D? 4, R/S L? 3, R/S answer B= 53.1301
Next Equalities,This is a Equations that contains a equal sign = and more than one variable on the left.
example: X^2+Y^2= Z^2 or the same X² +Y² =Z² is a Equality, for a bearing it would look like this.
D ÷ L = TAN ( B )
Run: EQN solve B, D? 3,R/S.L? 4, R/S answer is B =36.8699 this is true in this case,
Now lets move on to Programs, I have showed you some already ,Here is Polar to Rectangular in key strokes on a HP 33, this calculator has conversion keys ,Key in 53.1301,then Enter,then key in 5,then press →x,y , go rect.answer 4.0000 on top row and 3.0000 on bottom row of display now reverse it key in 4 ,then ENTER then 3 then press → Θ,r go polar answer 53.1301 on top row and 5.000 on bottom row of display that is how it work for many years on HP calculators , Now that has all changed to complex numbers systems. So on the HP 35s you have to write a program to do this, which is no big deal. these are two short programs there are a lot more ,these are my personal programs,so here is R to P and P to R,
1. LBL P,,,,,,,,,,,,,,LBL R
2.X<>Y,,,,,,,,,,,,,,,,X<>Y
3. i,,,,,,,,,,,,,,,,,,,,COS
4. x,,,,,,,,,,,,,,,,,,,X<>Y
5. +,,,,,,,,,,,,,,,,,,,LASTx
6.ARG,,,,,,,,,,,,,,,,,SIN
7.LAST x,,,,,,,,,,,,,X<>Y
8. ABS,,,,,,,,,,,,,,,,,,,x
9.RTN,,,,,,,,,,,,,,,,,,X<>Y
10.,,,,,,,,,,,,,,,,,,,,,,,LASTx
11.,,,,,,,,,,,,,,,,,,,,,,,,,,,x
12.,,,,,,,,,,,,,,,,,,,,,,,RTN
Like i said ,there are a lot more of these, some with equations in them and very long programs, but i use mine more than the others,as long as it works .Here is one similar to keystrokes,
HP 35s,,,,,,,,,,,,,,,,,,,,,,,,Now on HP Prime, macro RPN
1.LBL B,,,,,,,,,,,,,,,,,,,,,,,1."DEG"
2.INPUT X,,,,,,,,,,,,,,,,,,,,2."INPUT"
3.STO X,,,,,,,,,,,,,,,,,,,,,,,3."STO 1"
4.INPUT Y,,,,,,,,,,,,,,,,,,,,4."INPUT"
5.STO Y,,,,,,,,,,,,,,,,,,,,,,,5."STO 2"
6.RCL X,,,,,,,,,,,,,,,,,,,,,,,6."RCL 1"
7.RCL Y,,,,,,,,,,,,,,,,,,,,,,,7."RCL 2"
8. ÷,,,,,,,,,,,,,,,,,,,,,,,,,,,,8." ÷ "
9.ATAN,,,,,,,,,,,,,,,,,,,,,,,,9."ATAN"
10.RTN,,,,,,,,,,,,,,,,,,,,,,10."PAUSE"
Now dist.,,,,,,,,,,,,,,,,,,,,11."RTN"
1.LBL D,,,,,,,,,,,,,,,,,,,,,,1."DEG"
2.INPUT X,,,,,,,,,,,,,,,,,,,2."INPUT"
3.X²,,,,,,,,,,,,,,,,,,,,,,,,,,,,3."X^2"
4.INPUT Y,,,,,,,,,,,,,,,,,,,4."INPUT"
5.X²,,,,,,,,,,,,,,,,,,,,,,,,,,,,5."X^2"
6. +,,,,,,,,,,,,,,,,,,,,,,,,,,,6."+"
7. √,,,,,,,,,,,,,,,,,,,,,,,,,,,7."SQRT"
8. RTN,,,,,,,,,,,,,,,,,,,,,,,,8."PAUSE"
9.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9."RTN"
10.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10."END"
Here is some more Prime macro RPN this is a inverse program i wrote also.
(invp) macro RPN HP Prime by Billy Brooks 3/15/2016
1."DEG"
2."INPUT"// NORTH 1
3."STO 1
4."INPUT"// EAST 1
5."STO 2"
6."INPUT "// NORTH 2
7."STO 3"
8."INPUT"// EAST 2
9."STO 4"
10."RCL 2"
11. "RCL 4"
12. "-"// minus
13."STO 5"
14."RCL 1"
15."RCL 3"
16."-"//minus
17."STO 6"
18."RCL 5"
19."RCL 6"
20."POLAR"
21."SWAP"
22. 180
23" + "
24.">DMS"
25."PAUSE"
26 "RTN"
27."END"
This is a very good inverse program for the HP Prime this is in HP Prime Macro RPN,this is not
HPPPL programming ,this programs are macro programs of the HPPPL programming they will not work with out it's macro Base program that controls it,these program must be installed first.
Now here is a macro RPN r to p conversion,this macro ( rtop ) .
1. "DEG"
2." INPUT "
3."INPUT "
4."POLAR"
5."SWAP"
6.">DMS"
7."END"
This is similar to or having a R to P Keys,but i added DMS to it, remove line #6 ,and your answer will be in DD of a Degree. Here is P to R or (ptor) macro RPN Prime
1."DEG"
2."INPUT"// bearing in DD
3."INPUT"// dist.
4."RECT"
5."END"
This can be wrote were you enter DMS, but this is to be similar to key strokes of the calculator for the purpose of math.
Now Here are programs for the HP 50g in RPL language.First create variable 'd 'and 'L' then,go program,
<<<<<d L / ATAN >> ,Now name it 'BRG' Now all you have to do is sto vars in d and L, then press 'BRG' in VARS d= DEP and L = LAT. your answer will be the Bearing.
Now the Distance.
Go program,
<<<<<d sq L sq + √ >> and name it ' DIST ' ,the same VARS you stored in d and L are still there so all you have to do is press 'DIST ' in VARS and your answer is displayed.
So far I have showed you 4 Programming languages that are use on HP calculators today. Hopes help you make up your mine about what you like to learn and what you can do with a HP calculator.
The HP prime Program, EXPORT ATAN2(X,Y) has a extra variable d added, The original program looks like this.
EXPORT ATAN2(x,y)
BEGIN
LOCAL r:=ARG(x+y*i);
IF (r < 0) THEN
IF (HAngle) THEN
r := r + 360;
ELSE
r := r + 2*π;
END;
END;
RETURN r;
END;
You can also see this on the link i gave on Eddie Shore Math Blog.
But here is a HP Prime Program in Macro RPN, using key stroke order of
INPUT E1, INPUT E2, - ,INPUT N1,INPUT N2 , - ,GO POLAR, SWAP +180 END
This is in the order of doing a inverse manually on a HP RPN calculator.
STACK
T:0
Z:0
Y:dist.
X:azimuth
macro (inver) RPN , These programs are wrote in "strings"
This is a HP Prime Program, your answer will be put on a 4 level stack in the order as shown above.
1. " DEG "
2. " INPUT "
3." INPUT "
4. " - "
5. " STO 1 "
6. " INPUT "
7. " INPUT "
8. " - "
9. " STO 2 "
10. " RCL 1 "
11. " RCL 2 "
12. " POLAR "
13. " SWAP "
14. 180
15. " + "
16. " END "
This program was wrote by Billy Brooks, HP Prime ,macro RPN logic. (inver)
Run Program
INPUT LINE 2, X=5000............E1
INPUT LINE 3,X=5208.71.........E2
INPUT LINE 6,X=5000..............N1
INPUT LINE 7,X=5000..............N2
***STACK***
T: 0
Z: 0
Y: 208.71 dist.
X: 90 azimuth
and that is how it is done on a HP Prime in RPN
these programs run in TEXTBOOK ENTRY in HOME.
Hope this helps.
Check this one out, B=ABS ( ATAN ( E ÷ N )) HP 35s
Now a HP Prime Program
EXPORT ATAN2 ( x ,y )
BEGIN
LOCAL r:=ARG (x + y *i );
LOCAL d:=ABS ( X + Y *i );
IF ( r <0 ) THEN
IF ( HAngle ) THEN
r:= r + 360 ;
ELSE
r:= r + 2 * π ;
d:=ABS ( X + Y *i ) ;
END;
END;
RETURN r;
RETURN d;
END;
Yes this will inverse the Bearing from X and Y or Dep. and Lat. Sums
This program was wrote by Pellelil ,source Eddie Shore Math Blog
Just one more way of doing it.
http://edspi31415.blogspot.com.es/2013/11/atan2-using-tan-1-and-ang...
Hi Sabaretnam, If you like to see calculator Programs and equation ,simple to using complex numbers,solving these variable's ,then read my Discussion, The Little Big Calculator,that calculated i think i can. I show many ways to do this with or without a HP calculator,The HP 35s is featured in this discussion here on LSU.So if you like to learn how to use a HP calculator with RPN ,this is a good time and place to start.
http://landsurveyorsunited.com/forum/topics/the-little-big-calculat...
Here Sabaretnam, Write these down. These are using complex variables
B = ARG ( X + Y x i )
where B = Bearing , X = DEP. , Y = LAT.
D = ABS ( X + Y x i )
WHERE D = distance , X =DEP. ,Y = LAT.
Now RECT to POLAR
P = ABS (X + Y x i ) + ARG ( X + Y x i ) x i
Now POLAR to RECT
R = ( X x COS ( Y )) + ( X x SIN ( Y )) x i
This is just some examples. Hope this helps.