Post Reply 
input issues
01-27-2021, 11:45 AM (This post was last modified: 01-27-2021 01:13 PM by Amer7.)
Post: #17
RE: input issues
How do I enable an angle value in Deg, min, sec to be inputted into a program?
When I use ;
Code:
LOCAL a,d,sa,sd;
INPUT({a,d,sa,sd},"Input test", {"Directional angle","lenght A-B","S ugla(sec)","s lenght"});
It doesnt let me input the angle, if I press a b/c to inport the angle as a fraction I get Bad argument type.

Also I'm having an issue printing Matrices row by row for easier viewing.

Lets supose my matrix is 2x2 = B
PRINT (B(1)); - should print first row
PRINT (B(2)); - should print second row but i get a Sytax eror.

Code:
EXPORT Direkcioni()
BEGIN
LOCAL a,d,sa,sd;
INPUT({a,d,sa,sd},"Input test", {"Direkcioni ugao","Duzina A-B","S ugla(sec)","s duzine"});
LOCAL b11,b12,b21,b22; /// MAT B
b11:=COS(a);
b12:=-(d*SIN(a));
b21:=SIN(a);
b22:=(d*COS(a));
B:=[[b11,b12],[b21,b22]];
LOCAL c1,c2; /// MAT Cl
c1:=sd^2;
c2:=(sa/(206264.8^2));
C:=CAS.diag({c1,c2});

LOCAL Cx,p,sx,sy; ///MAT Cx

Cx:=B*C*TRN(B);
p:=(Cx(1,2))/(SQRT(Cx(1,1)*Cx(2,2)));
sx:=SQRT(Cx(1,1));
sy:=SQRT(Cx(2,2));

/// RACUNANJE R

LOCAL R,l1,l2;    ///=lambda 1, l2=lambda 2, R=R
R:=SQRT(((Cx(1,2)+Cx(2,2))^2)+4*((Cx(1,2))^2));
l1:=(0.5*(Cx(1,1)+Cx(2,2)+R));
l2:=(0.5*(Cx(1,1)+Cx(2,2)-R));

/// RACUNANJE UGLA O
LOCAL O1;
O=ATAN((l1-Cx(1,1))/(Cx(1,2)));
IF O<0 THEN
O1:=O+180;
ELSE
O1:=O;
END;

/// RACUNANJE A i B
A:=SQRT(l1);
B:=SQRT(l2);

/// ISPIS

PRINT({"O="+→HMS(O1)});
PRINT("_____________");
PRINT ("MATRICA B");
PRINT (B);
PRINT (B);
PRINT("________________");
PRINT ("MATRICA Cl");
PRINT (C);
PRINT (C);
PRINT("_____________");
PRINT ("MATRICA Cx");
PRINT (Cx);
PRINT (Cx);
PRINT("_____________");
PRINT("P="+p);
PRINT("A="+A);
PRINT("B="+B);

END;
   
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
input issues - Amer7 - 01-25-2021, 02:07 PM
RE: input issues - Didier Lachieze - 01-25-2021, 02:38 PM
RE: input issues - Amer7 - 01-25-2021, 03:13 PM
RE: input issues - rprosperi - 01-25-2021, 03:47 PM
RE: input issues - Amer7 - 01-25-2021, 03:53 PM
RE: input issues - Didier Lachieze - 01-25-2021, 04:03 PM
RE: input issues - Amer7 - 01-25-2021, 04:38 PM
RE: input issues - Didier Lachieze - 01-25-2021, 05:00 PM
RE: input issues - Amer7 - 01-25-2021, 06:25 PM
RE: input issues - C.Ret - 01-25-2021, 07:13 PM
RE: input issues - Didier Lachieze - 01-25-2021, 07:32 PM
RE: input issues - Amer7 - 01-25-2021, 07:42 PM
RE: input issues - toml_12953 - 01-26-2021, 04:34 PM
RE: input issues - C.Ret - 01-25-2021, 07:36 PM
RE: input issues - Amer7 - 01-25-2021, 08:00 PM
RE: input issues - Amer7 - 01-26-2021, 03:01 PM
RE: input issues - Amer7 - 01-27-2021 11:45 AM
RE: input issues - Didier Lachieze - 01-27-2021, 01:59 PM



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