Post Reply 
multi criteria IF statement
06-11-2021, 11:59 AM
Post: #3
RE: multi criteria IF statement
Thanks,
that worked like charm. I wonder where, and how you learn these tricks and expressions.

Here is the complete code for Directional Angle - Geodesy - HP Prime
Code:
EXPORT Directional()
BEGIN
LOCAL Ay,Ax,By,Bx;
INPUT({Ay,Ax,By,Bx},"Direkcioni", {"Y tacke A","X tacke A","Y tacke B","X tacke b"});

LOCAL y,x,n,c;
y:=By-Ay;
x:=Bx-Ax;

CASE
  IF y>0 AND x>0 THEN n:=ATAN(y/x) END;
  IF y>0 AND x<0 THEN n:=ATAN(y/x)+180 END;
  IF y<0 AND x<0 THEN n:=ATAN(y/x)+180 END;
  IF y<0 AND x>0 THEN n:=ATAN(y/x)+360 END;
  DEFAULT n:="error"
 END;
 c:=→HMS(n);
 RETURN c;
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
multi criteria IF statement - Amer7 - 06-11-2021, 11:06 AM
RE: multi criteria IF statement - Amer7 - 06-11-2021 11:59 AM
RE: multi criteria IF statement - Dougggg - 06-12-2021, 03:05 AM
RE: multi criteria IF statement - Joe Horn - 06-13-2021, 01:10 PM



User(s) browsing this thread: 1 Guest(s)