News:

When posting a problem be sure to include which version you are using.  Give as much information as possible.  If the problem is with a specific file be sure to attache it to your post.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

PPM right triangle

Started by sauerkraut2018, May 20, 2022, 11:59:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sauerkraut2018

PPM right triangle

given:
Hypotenuse 1000
Adjacent 866
sought:
opposite side
adjacent angle
opposite side angle

Desired output as text:
Hypotenuse 1000
Adjacent 866
Counter leg 500
Adjoining angle 30 degrees
Opposite side angle 60 degrees

In PPM I get the hypothnuse, adjacent leg and opposite leg.
Problem:
Angle adjacent = arcsin(adjacent/hypothenuse) is not output.
Angle opposite side = arccos((adjacent side/hypothenuse) is not output.

Is there a solution so that the calculated values are output to me?

Thanks in advance for your contributions.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

#1
Maybe this is why.
for some reason - to confuse us I think asin and acos return an answer in radians.
So you need to convert to Degrees.

The other thing that catches me sometimes is that both functions only work when the parameters are between -1 and 1.
I think that is because you are working with the Hypoteneuse
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

#2
//Angle test
Units(1[mm])

//Op = Parameter("Opposite",1000,LINEAR)
Adj = Parameter("Adjacent",600,LINEAR)
hyp = Parameter("Hypotoneuse",1000,LINEAR)


A = acos(Adj/hyp)*180/PI
Op = Adj*tan(A)

Fnt = TextFont(0,20,0,"Verdana")
Fsty = TextStyle(CENTER, BOTTOM)

t1 = Move(Text(""+A+"", Fnt, Fsty),Adj)
l1 = Polyline(Point(0,0),Point(Adj,0),Point(0,Op),Point(0,0))

B = asin(Adj/hyp)*180/PI

t2 = Move(Text(""+B+"", Fnt, Fsty),0,Op)
t3 = Move(RotateZ(Text(""+Op+"", Fnt, Fsty),90),0,Op/2)

Output(t1,l1,t2,t3)



Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

sauerkraut2018

Hello Niki,

Thank you very much, it worked wonderfully.

But there are several things I don't understand.
1. Is there a difference between "acos" and "arccos" or "asin" and "arcsin"?
In my script I used arccos and arcsin respectively.

2. When outputting text, use "Text(""+A+""..."" or Text(""+Op+""... why the double quotation marks and why the two + signs (+A+)?

3. Is it correct that I only need the conversion for the text output and TC then internally converts it into degrees and vice versa?

4. I have a collection of formulas here that show various calculations for the triangle.
For example,
given: the sides a+b or a+c or c+b
or given: the sides and the angles c+A, c+B, a+B
or given b+B, b+A, a+A
I have written the respective formulas as ppm, so that after entering the respective parameters, the resulting triangle is output to me. That works. Now I would like to output the respective calculated values ��(there are the given values ��and the calculated values) below the triangle as text.
Do I have to write a separate output for each case or can the results be summarized.
I had already tested various tests with "IF".
I had already tried with "Array".
In both cases with moderate success.

Thanks and greetings Sauerkraut
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

#4
Hi
Sorry I have been away
1. I think they both are the same thing - it's just different syntax. arccos and arcsin  don't work for me.
2. The text function expects a string. The double quotation marks convert the value of the reference to a string.
 Andy did provide a good explanation
https://forums.turbocad.com/index.php/topic,27491.0.html
 3. No, the asin and acos values do need to be converted back to degrees - unless you need them to be in Radians.
It is confusing because the other trig functions (in ppm) work with degrees.
4. I am not sure.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

I agree with Nikki about asin and arcsin, it's just the way they wrote back then when they made ppm for use with TC, maybe they need that because of the language TC was written in back then ??
If we go to SD it use arcsin and don't understand asin.

And inside the double "" we can write more txt and do calculations if put it in between ()
Sample from your triangle Q, Nikki was quicker :);
TXT6 = SetProperties(Move(Text("Area = "+(((B*X3)/2)/1000000)+" m2 ", Fnt, Fsty),B,0),"PenColor"=1x0ff0f);

I use a lot of this () to isolate each calculation, as it have happen it will not work in English system if they are not there.

I also believe you will need to make a calculation for each option you want to use and then use IF to select the correct one based on a Set parameter.

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

nikkipollard

Oh I didn't realise you were using SD.
I just checked
arcsin and arccos, in SD, seem to return the value in degrees.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

I basically use TC's ppm, as i use them in drawings there :)

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

nikkipollard

Quote from: Torfinn on June 03, 2022, 03:07:49 AMI basically use TC's ppm, as i use them in drawings there :)

Torfinn
Me too
I took the time to set up a user defined language, for ppm, in notepad++ to speed up the boring typing.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

sauerkraut2018

Hello Nikki, hello Torfinn,

thank you very much for your contributions.

As always, I will need some time to test your tips.

I myself have SD and the help for it on my computer, otherwise I use the Turbocad help
mostly from TC17 not TC2017.
But to write a ppm I use the "normal" Windows editor.

@Torfinn:
Quote: I took the time to set up a user defined language, for ppm, in notepad++ to speed up the boring typing.

How did you do that? Is there a guide or template for this?
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Please remind me:
>What does SD stand for?
>How can I get a copy of that SD PPM scripting HELP Documentation sauerkraut mentioned?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

Quote from: sauerkraut2018 on June 03, 2022, 10:21:47 PM@Torfinn:
Quote: I took the time to set up a user defined language, for ppm, in notepad++ to speed up the boring typing.

How did you do that? Is there a guide or template for this?
In the notepad++ folder in program files there is a autoCompletion folder
- something like this
C:\Program Files (x86)\Notepad++\autoCompletion
There are a few .xml files in there. I copied one and edited it - replacing the keywords of the copied file with ppm keywords I named the new file Tcppm.xml
In Notepad++  "language | user defined language | define your language". I set up the a new language as close to TC colours as I could and saved as Tcppm
Here are my files - You can modify them- I have changed the names so that you can tell the difference.
Import the colour one - using the menu in define your language and save as Tcppm. and copy and rename the other file to the autocompletion folder. Both files need to have the same name.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

Quote from: Alvin Gregorio on June 04, 2022, 03:11:29 AMPlease remind me:
>What does SD stand for?
>How can I get a copy of that SD PPM scripting HELP Documentation sauerkraut mentioned?
It is a separate program we were asked to trial before it was added to TC.
 I am not sure if it is still available.
It has a lot more features then our ppm
and the help is available in the program - which is very useful.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

#13
Quote from: nikkipollard on June 04, 2022, 03:52:29 AM
Quote from: Alvin Gregorio on June 04, 2022, 03:11:29 AMPlease remind me:
>What does SD stand for?
>How can I get a copy of that SD PPM scripting HELP Documentation sauerkraut mentioned?
It is a separate program we were asked to trial before it was added to TC.
 I am not sure if it is still available.
It has a lot more features then our ppm
and the help is available in the program - which is very useful.

SD.  What word does the S stand for?; and what word does the D stand for?

And who is "we"?

Thanks
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Torfinn

SymbolDesigner ;)

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

Alvin Gregorio

Quote from: Torfinn on June 04, 2022, 04:25:48 AMSymbolDesigner ;)

Torfinn

Thanks Torfinn.  Who is the "we" Nikki referred to?

And when did that trialing of SD occur?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Torfinn

Quote from: sauerkraut2018 on June 03, 2022, 10:21:47 PM@Torfinn:
Quote: I took the time to set up a user defined language, for ppm, in notepad++ to speed up the boring typing.

How did you do that? Is there a guide or template for this?

It was Nikki that do it that way, i use TC's editor, or in SD editor

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

Torfinn

Quote from: Alvin Gregorio on June 04, 2022, 04:27:26 AM
Quote from: Torfinn on June 04, 2022, 04:25:48 AMSymbolDesigner ;)

Torfinn

Thanks Torfinn.  Who is the "we" Nikki referred to?

And when did that trialing of SD occur?

"We" are the users inside TC forum
They stop develop it 1 year ago or something like that, order from the border.

It come in 2013, but the tread was moved in 2017, so only a link to it's new place in 2013 now
And near the bottom there the latest link for download is ;

ftp://serbin:Phog4iej@ftp.softdev.spb.ru/SymbolDesigner/build116

I did try the link, and it opens the ftp page , i did stop it there, as i have a different one, so don't take the risk of messing up anything :)

The 2 original place for tread have some examples etc that can be very good to have, it was Dave that put out the first link
So scroll down and find it from tread starter  DTTurbocad or something like that in 2013

Torfinn

V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

sauerkraut2018

Hello,

sorry, I swapped your two names above:
@Torfinn:
Quote: I took the time to set up a user defined language, for ppm, in notepad++ to speed up the boring typing.
How did you do that? Is there a guide or template for this?

It should have read @Nikki:
That was my mistake, sorry.
-------------------------------------------------- ------------------
Now really @Nikki:
Quote:
In the notepad++ folder in program files there is an autoCompletion folder
- something like this
C:\Program Files (x86)\Notepad++\autoCompletion

I searched for this directory, but unfortunately this directory does not exist on my computer. I am using NPP V7.5.9-64bit.
Also the installation directory is NOT under C:\ProgramFiles((x86)

Attached is a picture of my NPP directory structure.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Torfinn

Notepad ++ is not the same as windows notebook or what the name is in english :)
You need to download and install it, it's a free open source program.
https://notepad-plus-plus.org/downloads/

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

sauerkraut2018

Hello Torfinn,

I uninstalled the old version and reinstalled the current version.
And what a joy, it worked right away.

Thank you for your (all of you, of course) patient and tireless help.

P.S.
Someone once wrote that PPMs are addictive. He wasn't entirely wrong.  ;)
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

sauerkraut2018

Hello,

Continuation:

I tested the following: ( + , & , AND , ++)

res1 = IF(par1>0 + par2>0, Output(calculation),mistake);     //it's not working
res2 = IF(par1>0 & par2>0, Output(calculation),mistake);     //it's not working
res3 = IF(par1>0 AND par2>0, Output(calculation),mistake);     //it's not working
res4 = IF(par1>0 ++ par2>0, Output(calculation),mistake);     //it's not working

Thank you for your help.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

I couldn't find a way to use 2 conditions with an IF function.
I do something like this as a workaround

Units(1[mm])

conA = 10
conB = 100

tfont = TextFont(0,200,0,"Verdana")
tsty = TextStyle(LEFT,BOTTOM)

mistake = Text("Mistake",tfont,tsty)
calc = conA*conB
calculation = Text(""+calc+"",tfont,tsty)

n1 = IF(conA>0,1,0)
n2 = IF(conB>0,1,0)

res1 = IF(n1+n2 == 2,calculation,mistake)

Output(res1)

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

A small adjustment on Nikki's ppm

Units(1[mm])

conA = 10
conB = 100

tfont = TextFont(0,200,0,"Verdana")
tsty = TextStyle(LEFT,BOTTOM)

mistake = Text("Mistake",tfont,tsty)
calc = conA*conB
calculation = Text(""+calc+"",tfont,tsty)

n1 = IF(conA==0,mistake,IF(conB==0,mistake,calculation));

Output(n1)
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

nikkipollard

I normally use Torfinns method.
I use my method when the conditions get really complicated
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

sauerkraut2018

#25
Hello Nikki, Hello Torfinn,

once again you have helped me a lot. The scripts work wonderfully with two queries.

So far so good I thought. Then it's easy to add a third step. To increase the level of difficulty, so to speak.

So I tested the following:
conA=parameter("InputA,"0",LINEAR, Interval(0,10000));
conB=parameter("InputB,"0",LINEAR, Interval(0,10000));
conC=parameter("InputC,"0",LINEAR, Interval(0,10000));

calc1=sqrt(5000*5000-4000*4000);
calc2=sqrt(5000*5000-3000*3000);
calc3=sqrt(4000*4000+3000*3000);

n1 = IF(conA>0,1,0);
n2 = IF(conB>0,1,0);
n3 = IF(conC>0,1,0)

// Now the output
Out1=IF(n1+n2==2, IF(n3=0, Output(calc1),Out2),Out2);
Out2=IF(n1+n3==2, IF(n2=0, Output(calc2),Out3),Out3);
Out3=IF(n2+n3==2, IF(n1=0, Output(calc3),Mistake),Mistake);

Output(Out1);
// ProgEnd

Now I enter in the input mask
- enter the values
a. conA =5000 and conB=3000, conC = 0 --> the output works.
b. I change conA=5000, conB = 0, conC=4000 --> The output works.
c. I change conA = 0, conC=3000, conB=2000 --> The output doesn't work, TC usually even crashes.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

#26
You have confused me.
What are you trying to do?
What are InputA, InputB, InputC?
I presume they are sides of a right angle triangle
 - you seem to be trying to find the length of the 3rd side

another totally different method

Units(1[mm])
conA=Parameter("InputA",10,LINEAR, Interval(0,10000));
conB=Parameter("InputB",20,LINEAR, Interval(0,10000));
find = Parameter("Find", "hypotenuse", TEXT, Set("hypotenuse", "adjacent","opposite"))

// a short side option - opposite or adjacent

hyp1 = max(conA,conB)
side1 = min(conA,conB)
side = sqrt(hyp1*hyp1-side1*side1)


//hypotenuse option

hyp = sqrt(conA*conA + conB*conB)

tfont = TextFont(0,hyp2/15,0,"Verdana")
tsty = TextStyle(CENTER,MIDDLE)
d = hyp2/30  // spacing for text text height adjusts to suit triangle

//draw triangle
adj = IF(find == "hypotenuse",conA,IF(find == "adjacent",side,side1)) 
opp = IF(find == "hypotenuse",conB,IF(find == "adjacent",side1,side))
hyp2 = IF(find == "hypotenuse",hyp,hyp1)

tria = Polyline (Point(0,0),
               Point(adj,0),
               Point(0,opp),
               Point(0,0))

ts2 = Move(Text(""+adj+"",tfont,tsty),adj/2,-d)
ts3 = Move(RotateZ(Text(""+opp+"",tfont,tsty),90),-d,opp/2)
AA = atan(opp/adj)
th2 = Move(RotateZ(Text(""+hyp2+"",tfont,tsty),-AA),(adj+d*1.5)/2,(opp+d*1.5)/2)
hcol = IF(find == "hypotenuse",SetProperties(th2,"PenColor" = 255),th2)
acol = IF(find == "adjacent",SetProperties(ts2,"PenColor" = 255),ts2)
ocol = IF(find == "opposite",SetProperties(ts3,"PenColor" = 255),ts3)

Output(tria,ocol,acol,hcol);





Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

sauerkraut2018

Hello Nikki,

QuoteYou have confused me.
Oh, sorry, I certainly didn't mean to do that.

QuoteWhat are you trying to do? What are InputA, InputB, InputC?
I found your pdf file trig-formula.pdf here https://forums.turbocad.com/index.php/topic,22108.msg132568.html#msg132568.
Now I'm trying to incorporate these formulas into a ppm.
For this I would like to get an output by entering 2 parameters.
This input is like in your document "known: ... , for example: a+b or c+A or b+B or ...
As an output I would like:
hypotenuse = ... mm
adjacent leg = ... mm
Opposite side = ... mm
Angle A = ... degrees
Angle B = ... degrees

QuoteI presume they are sides of a right angle triangle
Absolutely correct.

Quote- you seem to be trying to find the length of the 3rd side
... and the other missing values as described above.


Quoteanother totally different method
I copy your code snippet to test it.

Thank you again for your help.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

sauerkraut2018

Hello Nikki,

I haven't had much time in the past few weeks. Work/boss came first.

Today I have time to take care of your script. After a few minor adjustments I got it working. It now works as it should.
Thanks a lot for this.

In the next step I now try (as already described) to incorporate the two angles alpha and beta. This means that if I enter an angle (alpha, beta) and a side (Hyp,adj, opp), the calculated values should be output.

It won't be easy, but maybe it will work.

Thanks again for your help. See you.
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Torfinn

Hei Surkål

Why is this this difficult ?
You need to know if it is angle A or B, can be done with a Checkbox or Set,
and if it is Adj, Opp or Hyp, can be done with a Set.
Then some IF's and of course the 2 values.

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

sauerkraut2018

Hello,

I wanted to get in touch again. I'm currently on vacation, so I can take care of the ppm again.

As described in post #27 I tried to write a working ppm. Now here is the result.
Actually it works, but after two or three (several) attempts the vegetable crashes.
Please test it .
As described in the pdf (#27), 2xTRUE and 2 values are entered.

Unfortunately I still can't upload files to the forum, so use ctrl-c and ctrl-v.

//-----------------------------------------------
Units(1[mm]);
//-----------------------------------------------

//-----------------------------------------------
//-Parameter-------------------------------------
//-----------------------------------------------

//Text001 = Parameter("Eingabe von 2 Werten, andere 0", " ", TEXT ,0);
Hypothenuse = Parameter ("Hypothenuse", 0 ,LINEAR, Interval(0,6000));
Ankathete = Parameter ("Ankathete", 0 ,LINEAR, Interval(0,6000));
Gegenkathete = Parameter ("Gegenkathete", 0 , LINEAR, Interval(0,6000));
AnWinkel = Parameter ("AnWinkel", 0 ,ANGULAR , Interval(0,89.9));
GegenWinkel = Parameter ("GegenWinkel", 0 , ANGULAR , Interval(0,89.9));
//--------------------------------------------------------------
// Checkboxen
//--------------------------------------------------------------
IFSeitea = Parameter ("Seite  a, GK  T=1 F=0", 1, CHECKBOX);
IFSeiteb = Parameter ("Seite  b, AK  T=1 F=0", 1, CHECKBOX);
IFSeitec = Parameter ("Seite  c, Hyp T=1 F=0", 0, CHECKBOX);
IFWinkelA = Parameter ("Winkel A, AK, T=1 F=0", 0, CHECKBOX);
IFWinkelB = Parameter ("Winkel B, GK, T=1 F=0", 0, CHECKBOX);
//-----------------------------------------------
// Parameter sortieren
//-----------------------------------------------
//ABC = (Kontrolle01,Hypothenuse,Kontrolle02,Ankathete,Kontrolle03,Gegenkathete,Kontrolle04,AnWinkel,Kontrolle05,GegenWinkel);
ABC = (IFSeitea,IFSeiteb,IFSeitec,IFWinkelA,IFWinkelB,Gegenkathete,Ankathete,Hypothenuse,AnWinkel,GegenWinkel);
Output(ABC);
//-----------------------------------------------
//-----------------------------------------------
//
//
//         /| GW
//        / |
//       /  |
//   H  /   | G
//     /    |
//    /     |
//   / AW   |
//  ---------
//      A
//
//-----------------------------------------------
// Berechnungen der erforderlichen Werte
//-----------------------------------------------
// ZG1: Geg.: Gegenkathete und Ankathete, gesucht: H, AW,GW
Hypothenuse1=sqrt(Gegenkathete*Gegenkathete+Ankathete*Ankathete);
AnWinkel1=arctan(Gegenkathete/Ankathete);
GegenWinkel1=arctan(Ankathete/Gegenkathete);
//-----------------------------------------------
// ZG2: Geg.: Gegenkathete und Hypothenuse, gesucht: A, AW, GW
Ankathete2=sqrt(Hypothenuse*Hypothenuse-Gegenkathete*Gegenkathete);
AnWinkel2=arcsin(Gegenkathete/Hypothenuse);
GegenWinkel2=arccos(Gegenkathete/Hypothenuse);
//-----------------------------------------------
// ZG3: Geg.: Hypothenuse und Ankathete, gesucht: G, AW, GW
Gegenkathete3=sqrt(Hypothenuse*Hypothenuse-Ankathete*Ankathete);
AnWinkel3=arccos(Ankathete/Hypothenuse);
GegenWinkel3=arcsin(Ankathete/Hypothenuse);
//-----------------------------------------------
// ZG4: Geg.: Hypothenuse und AnWinkel, gesucht: A, G, GW
Ankathete4=Hypothenuse*cos(AnWinkel);
Gegenkathete4=Hypothenuse*sin(AnWinkel);
GegenWinkel4=90-AnWinkel;
//-----------------------------------------------
// ZG5: Geg.: Hypothenuse und Gegenwinkel, gesucht: A, G, AW
Ankathete5=Hypothenuse*sin(GegenWinkel);
Gegenkathete5=Hypothenuse*cos(GegenWinkel);
AnWinkel5=90-GegenWinkel;
//-----------------------------------------------
// ZG6: Geg.: Gegenkathete und Gegenwinkel, gesucht: H, A, AW
Hypothenuse6=Gegenkathete/cos(GegenWinkel);
Ankathete6=Gegenkathete*tan(GegenWinkel);
AnWinkel6=90-GegenWinkel;
//-----------------------------------------------
// ZG7: Geg.: Ankathete und Gegenwinkel, gesucht: H, G, AW
Hypothenuse7=Ankathete/sin(GegenWinkel);
Gegenkathete7=Ankathete/tan(GegenWinkel);
AnWinkel7=90-GegenWinkel;
//-----------------------------------------------
// ZG8: Geg.: Ankathete und AnWinkel, gesucht: H, G, GW
Hypothenuse8=Ankathete/cos(AnWinkel);
Gegenkathete8=Ankathete*tan(AnWinkel);
GegenWinkel8=90-AnWinkel;
//-----------------------------------------------
// ZG9: Geg.: Gegenkathete und AnWinkel, gesucht: H, A, GW
Hypothenuse9=Gegenkathete/sin(AnWinkel);
Ankathete9=Gegenkathete/tan(AnWinkel);
GegenWinkel9=90-AnWinkel;
//-----------------------------------------------
//-----------------------------------------------

//--------------------------------------------------------------
//--------------------------------------------------------------
// Zeichnung 1 erstellen Geg.: Gegenkathete und Ankathete
//--------------------------------------------------------------
Zeichnung1=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete),Point(0,0));
//Output(Zeichnung1);
//--------------------------------------------------------------
// Zeichnung 2 erstellen Geg.: Gegenkathete und Hypothenuse
//--------------------------------------------------------------
Zeichnung2=Polyline(Point(0,0),Point(Ankathete2,0),Point(Ankathete2,Gegenkathete),Point(0,0));
//Output(Zeichnung2);
//--------------------------------------------------------------
// Zeichnung 3 erstellen Geg.: Hypothenuse und Ankathete
//--------------------------------------------------------------
Zeichnung3=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete3),Point(0,0));
//Output(Zeichnung3);
//--------------------------------------------------------------
// Zeichnung 4 erstellen Geg.: Hypothenuse und AnWinkel
//--------------------------------------------------------------
Zeichnung4=Polyline(Point(0,0),Point(Ankathete4,0),Point(Ankathete4,Gegenkathete4),Point(0,0));
//Output(Zeichnung4);
//--------------------------------------------------------------
// Zeichnung 5 erstellen Geg.: Hypothenuse und Gegenwinkel
//--------------------------------------------------------------
Zeichnung5=Polyline(Point(0,0),Point(Ankathete5,0),Point(Ankathete5,Gegenkathete5),Point(0,0));
//Output(Zeichnung5);
//--------------------------------------------------------------
// Zeichnung 6 erstellen Geg.: Gegenkathete und Gegenwinkel
Zeichnung6=Polyline(Point(0,0),Point(Ankathete6,0),Point(Ankathete6,Gegenkathete),Point(0,0));
//Output(Zeichnung6);
//--------------------------------------------------------------
// Zeichnung 7 erstellen Geg.: Ankathete und Gegenwinkel
Zeichnung7=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete7),Point(0,0));
//Output(Zeichnung7);
//--------------------------------------------------------------
// Zeichnung 8 erstellen Geg.: Ankathete und AnWinkel
//--------------------------------------------------------------
Zeichnung8=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete8),Point(0,0));
//Output(Zeichnung8);
//--------------------------------------------------------------
// Zeichnung 9 erstellen Geg.: Gegenkathete und AnWinkel
Zeichnung9=Polyline(Point(0,0),Point(Ankathete9,0),Point(Ankathete9,Gegenkathete),Point(0,0));
//Output(Zeichnung9);

//-----------------------------------------------
// Alternative
//-----------------------------------------------
SonstNIX1=Circle(20,0,0,0);
SonstNIX2=Circle(40,0,0,0);
SonstNIX3=Circle(60,0,0,0);
SonstNIX4=Circle(80,0,0,0);
SonstNIX5=Circle(100,0,0,0);
SonstNIX6=Circle(120,0,0,0);
SonstNIX7=Circle(140,0,0,0);
SonstNIX8=Circle(160,0,0,0);
SonstNIX9=Circle(160,0,0,0);
//Output(SonstNIX1);

//-----------------------------------------------
// IFSeitea==1 IFSeitea==0
// IFSeiteb==1 IFSeiteb==0
// IFSeitec==1 IFSeitec==0
// IFWinkelA==1 IFWinkelA==0
// IFWinkelB==1 IFWinkelB==0
//-----------------------------------------------

Sprung1=IF(IFSeitea==1, IF(IFSeiteb==1, IF(IFSeitec==0, IF(IFWinkelA==0, IF(IFWinkelB==0,Output(Zeichnung1),Output(SonstNIX1)),0),0),0),0);
Sprung2=IF(IFSeitea==1, IF(IFSeitec==1, IF(IFSeiteb==0, IF(IFWinkelA==0, IF(IFWinkelB==0,Output(Zeichnung2),Output(SonstNIX2)),0),0),0),0);
Sprung3=IF(IFSeiteb==1, IF(IFSeitec==1, IF(IFSeitea==0, IF(IFWinkelA==0, IF(IFWinkelB==0,Output(Zeichnung3),Output(SonstNIX3)),0),0),0),0);
Sprung4=IF(IFSeitec==1, IF(IFWinkelA==1,IF(IFSeitea==0, IF(IFSeiteb==0, IF(IFWinkelB==0,Output(Zeichnung4),Output(SonstNIX4)),0),0),0),0);
Sprung5=IF(IFSeitec==1, IF(IFWinkelB==1,IF(IFSeitea==0, IF(IFSeiteb==0, IF(IFWinkelA==0,Output(Zeichnung5),Output(SonstNIX5)),0),0),0),0);
Sprung6=IF(IFSeitea==1, IF(IFWinkelB==1,IF(IFSeiteb==0, IF(IFSeitec==0, IF(IFWinkelA==0,Output(Zeichnung6),Output(SonstNIX6)),0),0),0),0);
Sprung7=IF(IFSeiteb==1, IF(IFWinkelB==1,IF(IFSeitea==0, IF(IFSeitec==0, IF(IFWinkelA==0,Output(Zeichnung7),Output(SonstNIX7)),0),0),0),0);
Sprung8=IF(IFSeiteb==1, IF(IFWinkelA==1,IF(IFSeitea==0, IF(IFSeitec==0, IF(IFWinkelB==0,Output(Zeichnung8),Output(SonstNIX8)),0),0),0),0);
Sprung9=IF(IFSeitea==1, IF(IFWinkelA==1,IF(IFWinkelB==0,IF(IFSeitec==0, IF(IFSeiteb==0,Output(Zeichnung9),Output(SonstNIX9)),0),0),0),0);

Output(Sprung1,Sprung2,Sprung3,Sprung4,Sprung5,Sprung6,Sprung7,Sprung8,Sprung9);
//-----------------------------------------------
//Geg.: Gegenkathete und Ankathete -->Output(Zeichnung1);
//Geg.: Gegenkathete und Hypothenuse--> Output(Zeichnung2);
//Geg.: Hypothenuse und Ankathete --> Output(Zeichnung3);
//Geg.: Hypothenuse und AnWinkel --> Output(Zeichnung4);
//Geg.: Hypothenuse und Gegenwinkel --> Output(Zeichnung5);
//Geg.: Gegenkathete und Gegenwinkel --> Output(Zeichnung6);
//Geg.: Ankathete und Gegenwinkel --> Output(Zeichnung7);
//Geg.: Ankathete und AnWinkel --> Output(Zeichnung8);
//Geg.: Gegenkathete und AnWinkel --> Output(Zeichnung9);
//-----------------------------------------------

//-----------------------------------------------
RP=RefPoint(0,0,0);
Output(RP);
//-----------------------------------------------

//-----------------------------------------------
// Programm ENDE
//-----------------------------------------------
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Alvin Gregorio

Quote from: sauerkraut2018 on August 09, 2022, 07:03:34 AMHello,

I wanted to get in touch again. I'm currently on vacation, so I can take care of the ppm again.

As described in post #27 I tried to write a working ppm. Now here is the result.
Actually it works, but after two or three (several) attempts the vegetable crashes.
Please test it .
As described in the pdf (#27), 2xTRUE and 2 values are entered.

Unfortunately I still can't upload files to the forum, so use ctrl-c and ctrl-v.

//-----------------------------------------------
Units(1[mm]);
//-----------------------------------------------

//-----------------------------------------------
//-Parameter-------------------------------------
//-----------------------------------------------

//Text001 = Parameter("Eingabe von 2 Werten, andere 0", " ", TEXT ,0);
Hypothenuse = Parameter ("Hypothenuse", 0 ,LINEAR, Interval(0,6000));
Ankathete = Parameter ("Ankathete", 0 ,LINEAR, Interval(0,6000));
Gegenkathete = Parameter ("Gegenkathete", 0 , LINEAR, Interval(0,6000));
AnWinkel = Parameter ("AnWinkel", 0 ,ANGULAR , Interval(0,89.9));
GegenWinkel = Parameter ("GegenWinkel", 0 , ANGULAR , Interval(0,89.9));
//--------------------------------------------------------------
// Checkboxen
//--------------------------------------------------------------
IFSeitea = Parameter    ("Seite  a, GK  T=1 F=0", 1, CHECKBOX);
IFSeiteb = Parameter    ("Seite  b, AK  T=1 F=0", 1, CHECKBOX);
IFSeitec = Parameter    ("Seite  c, Hyp T=1 F=0", 0, CHECKBOX);
IFWinkelA = Parameter    ("Winkel A, AK, T=1 F=0", 0, CHECKBOX);
IFWinkelB = Parameter    ("Winkel B, GK, T=1 F=0", 0, CHECKBOX);
//-----------------------------------------------
// Parameter sortieren
//-----------------------------------------------
//ABC = (Kontrolle01,Hypothenuse,Kontrolle02,Ankathete,Kontrolle03,Gegenkathete,Kontrolle04,AnWinkel,Kontrolle05,GegenWinkel);
ABC = (IFSeitea,IFSeiteb,IFSeitec,IFWinkelA,IFWinkelB,Gegenkathete,Ankathete,Hypothenuse,AnWinkel,GegenWinkel);
Output(ABC);
//-----------------------------------------------
//-----------------------------------------------
//
//
//        /| GW
//        / |
//      /  |
//  H  /  | G
//    /    |
//    /    |
//  / AW  |
//  ---------
//      A
//
//-----------------------------------------------
// Berechnungen der erforderlichen Werte
//-----------------------------------------------
// ZG1: Geg.: Gegenkathete und Ankathete, gesucht: H, AW,GW
Hypothenuse1=sqrt(Gegenkathete*Gegenkathete+Ankathete*Ankathete);
AnWinkel1=arctan(Gegenkathete/Ankathete);
GegenWinkel1=arctan(Ankathete/Gegenkathete);
//-----------------------------------------------
// ZG2: Geg.: Gegenkathete und Hypothenuse, gesucht: A, AW, GW
Ankathete2=sqrt(Hypothenuse*Hypothenuse-Gegenkathete*Gegenkathete);
AnWinkel2=arcsin(Gegenkathete/Hypothenuse);
GegenWinkel2=arccos(Gegenkathete/Hypothenuse);
//-----------------------------------------------
// ZG3: Geg.: Hypothenuse und Ankathete, gesucht: G, AW, GW
Gegenkathete3=sqrt(Hypothenuse*Hypothenuse-Ankathete*Ankathete);
AnWinkel3=arccos(Ankathete/Hypothenuse);
GegenWinkel3=arcsin(Ankathete/Hypothenuse);
//-----------------------------------------------
// ZG4: Geg.: Hypothenuse und AnWinkel, gesucht: A, G, GW
Ankathete4=Hypothenuse*cos(AnWinkel);
Gegenkathete4=Hypothenuse*sin(AnWinkel);
GegenWinkel4=90-AnWinkel;
//-----------------------------------------------
// ZG5: Geg.: Hypothenuse und Gegenwinkel, gesucht: A, G, AW
Ankathete5=Hypothenuse*sin(GegenWinkel);
Gegenkathete5=Hypothenuse*cos(GegenWinkel);
AnWinkel5=90-GegenWinkel;
//-----------------------------------------------
// ZG6: Geg.: Gegenkathete und Gegenwinkel, gesucht: H, A, AW
Hypothenuse6=Gegenkathete/cos(GegenWinkel);
Ankathete6=Gegenkathete*tan(GegenWinkel);
AnWinkel6=90-GegenWinkel;
//-----------------------------------------------
// ZG7: Geg.: Ankathete und Gegenwinkel, gesucht: H, G, AW
Hypothenuse7=Ankathete/sin(GegenWinkel);
Gegenkathete7=Ankathete/tan(GegenWinkel);
AnWinkel7=90-GegenWinkel;
//-----------------------------------------------
// ZG8: Geg.: Ankathete und AnWinkel, gesucht: H, G, GW
Hypothenuse8=Ankathete/cos(AnWinkel);
Gegenkathete8=Ankathete*tan(AnWinkel);
GegenWinkel8=90-AnWinkel;
//-----------------------------------------------
// ZG9: Geg.: Gegenkathete und AnWinkel, gesucht: H, A, GW
Hypothenuse9=Gegenkathete/sin(AnWinkel);
Ankathete9=Gegenkathete/tan(AnWinkel);
GegenWinkel9=90-AnWinkel;
//-----------------------------------------------
//-----------------------------------------------

//--------------------------------------------------------------
//--------------------------------------------------------------
// Zeichnung 1 erstellen    Geg.: Gegenkathete und Ankathete
//--------------------------------------------------------------
Zeichnung1=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete),Point(0,0));
//Output(Zeichnung1);
//--------------------------------------------------------------
// Zeichnung 2 erstellen    Geg.: Gegenkathete und Hypothenuse
//--------------------------------------------------------------
Zeichnung2=Polyline(Point(0,0),Point(Ankathete2,0),Point(Ankathete2,Gegenkathete),Point(0,0));
//Output(Zeichnung2);
//--------------------------------------------------------------
// Zeichnung 3 erstellen    Geg.: Hypothenuse und Ankathete
//--------------------------------------------------------------
Zeichnung3=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete3),Point(0,0));
//Output(Zeichnung3);
//--------------------------------------------------------------
// Zeichnung 4 erstellen    Geg.: Hypothenuse und AnWinkel
//--------------------------------------------------------------
Zeichnung4=Polyline(Point(0,0),Point(Ankathete4,0),Point(Ankathete4,Gegenkathete4),Point(0,0));
//Output(Zeichnung4);
//--------------------------------------------------------------
// Zeichnung 5 erstellen    Geg.: Hypothenuse und Gegenwinkel
//--------------------------------------------------------------
Zeichnung5=Polyline(Point(0,0),Point(Ankathete5,0),Point(Ankathete5,Gegenkathete5),Point(0,0));
//Output(Zeichnung5);
//--------------------------------------------------------------
// Zeichnung 6 erstellen    Geg.: Gegenkathete und Gegenwinkel
Zeichnung6=Polyline(Point(0,0),Point(Ankathete6,0),Point(Ankathete6,Gegenkathete),Point(0,0));
//Output(Zeichnung6);
//--------------------------------------------------------------
// Zeichnung 7 erstellen    Geg.: Ankathete und Gegenwinkel
Zeichnung7=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete7),Point(0,0));
//Output(Zeichnung7);
//--------------------------------------------------------------
// Zeichnung 8 erstellen    Geg.: Ankathete und AnWinkel
//--------------------------------------------------------------
Zeichnung8=Polyline(Point(0,0),Point(Ankathete,0),Point(Ankathete,Gegenkathete8),Point(0,0));
//Output(Zeichnung8);
//--------------------------------------------------------------
// Zeichnung 9 erstellen    Geg.: Gegenkathete und AnWinkel
Zeichnung9=Polyline(Point(0,0),Point(Ankathete9,0),Point(Ankathete9,Gegenkathete),Point(0,0));
//Output(Zeichnung9);

//-----------------------------------------------
// Alternative
//-----------------------------------------------
SonstNIX1=Circle(20,0,0,0);
SonstNIX2=Circle(40,0,0,0);
SonstNIX3=Circle(60,0,0,0);
SonstNIX4=Circle(80,0,0,0);
SonstNIX5=Circle(100,0,0,0);
SonstNIX6=Circle(120,0,0,0);
SonstNIX7=Circle(140,0,0,0);
SonstNIX8=Circle(160,0,0,0);
SonstNIX9=Circle(160,0,0,0);
//Output(SonstNIX1);

//-----------------------------------------------
// IFSeitea==1 IFSeitea==0
// IFSeiteb==1 IFSeiteb==0
// IFSeitec==1 IFSeitec==0
// IFWinkelA==1 IFWinkelA==0
// IFWinkelB==1 IFWinkelB==0
//-----------------------------------------------

Sprung1=IF(IFSeitea==1,    IF(IFSeiteb==1,    IF(IFSeitec==0,    IF(IFWinkelA==0,    IF(IFWinkelB==0,Output(Zeichnung1),Output(SonstNIX1)),0),0),0),0);
Sprung2=IF(IFSeitea==1,    IF(IFSeitec==1,    IF(IFSeiteb==0,    IF(IFWinkelA==0,    IF(IFWinkelB==0,Output(Zeichnung2),Output(SonstNIX2)),0),0),0),0);
Sprung3=IF(IFSeiteb==1,    IF(IFSeitec==1,    IF(IFSeitea==0,    IF(IFWinkelA==0,    IF(IFWinkelB==0,Output(Zeichnung3),Output(SonstNIX3)),0),0),0),0);
Sprung4=IF(IFSeitec==1,    IF(IFWinkelA==1,IF(IFSeitea==0,    IF(IFSeiteb==0,        IF(IFWinkelB==0,Output(Zeichnung4),Output(SonstNIX4)),0),0),0),0);
Sprung5=IF(IFSeitec==1,    IF(IFWinkelB==1,IF(IFSeitea==0,    IF(IFSeiteb==0,        IF(IFWinkelA==0,Output(Zeichnung5),Output(SonstNIX5)),0),0),0),0);
Sprung6=IF(IFSeitea==1,    IF(IFWinkelB==1,IF(IFSeiteb==0,    IF(IFSeitec==0,        IF(IFWinkelA==0,Output(Zeichnung6),Output(SonstNIX6)),0),0),0),0);
Sprung7=IF(IFSeiteb==1,    IF(IFWinkelB==1,IF(IFSeitea==0,    IF(IFSeitec==0,        IF(IFWinkelA==0,Output(Zeichnung7),Output(SonstNIX7)),0),0),0),0);
Sprung8=IF(IFSeiteb==1,    IF(IFWinkelA==1,IF(IFSeitea==0,    IF(IFSeitec==0,        IF(IFWinkelB==0,Output(Zeichnung8),Output(SonstNIX8)),0),0),0),0);
Sprung9=IF(IFSeitea==1,    IF(IFWinkelA==1,IF(IFWinkelB==0,IF(IFSeitec==0,        IF(IFSeiteb==0,Output(Zeichnung9),Output(SonstNIX9)),0),0),0),0);

Output(Sprung1,Sprung2,Sprung3,Sprung4,Sprung5,Sprung6,Sprung7,Sprung8,Sprung9);
//-----------------------------------------------
//Geg.: Gegenkathete und Ankathete -->Output(Zeichnung1);
//Geg.: Gegenkathete und Hypothenuse--> Output(Zeichnung2);
//Geg.: Hypothenuse und Ankathete --> Output(Zeichnung3);
//Geg.: Hypothenuse und AnWinkel --> Output(Zeichnung4);
//Geg.: Hypothenuse und Gegenwinkel --> Output(Zeichnung5);
//Geg.: Gegenkathete und Gegenwinkel --> Output(Zeichnung6);
//Geg.: Ankathete und Gegenwinkel --> Output(Zeichnung7);
//Geg.: Ankathete und AnWinkel --> Output(Zeichnung8);
//Geg.: Gegenkathete und AnWinkel --> Output(Zeichnung9);
//-----------------------------------------------

//-----------------------------------------------
RP=RefPoint(0,0,0);
Output(RP);
//-----------------------------------------------

//-----------------------------------------------
// Programm ENDE
//-----------------------------------------------

I've seen some impressive creative things before, sauerkraut.
But what you came up with at Lines 37 through 45 is inspirational (as in opens the mind to think more creatively)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

sauerkraut2018

Thanks Alvin, now that your enthusiasm has calmed down...

Please test whether your TC crashes after several different entries.

In any case, for me it is the case that TC crashes after the 5th input at the latest.
What is the reason for this?
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

Torfinn

Hei Surkål :)

There is something wrong in your file when you use angles, as it crash inside the ppm then, it put it out, but are not happy about it, it don't make a Temp file so it's minor stuff
And 1 time i did put out a 45 degree triangle even if i set it to be 32 degree

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

nikkipollard

#34
I am not sure what the issue is maybe it is this

acos and asin - (or arccos and arcsin. )
can cause crashes because the parameter needs to be between -1 and 1.
Basically if the Hypotenuse is smaller then sides a or b then "AnWinkel3=arccos(Ankathete/Hypothenuse);"
wouldn't work because The value would be greater then 1 and the triangle wouldn't be possible.

Try put some error handling in that checks that the user has values that work even if that is not the sum that would be used for the chosen option - I hope that makes sense
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

There is 3 sections where there is used arctan/cos/sin instead of atan/cos/sin
In ZG1,2 and 3, TC don't know how to use them so they are seen like an external command, that we see because they are dark blue, when use atan/cos/sin it will be blue like they should be.
So change that will make it work correct with line/ angle i think to remember, but not line/ line

Maybe it's gone a bit wild in the "sprung" section IF, --- Output,IF, --- Output..... ??
Link show line/ line
https://drive.google.com/file/d/1VHgK7TIkIF7eL5of7b8D8ZAJdsiYr8Dr/view?usp=sharing

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

sauerkraut2018

Hello Torfinn, hello Nikki,

I got the ppm to run thanks to your help. It's working fine so far. Thank you very much.

First of all : (@Nikki)
I assume the user is aware that the hyphotenuse is the longest side in the right triangle.

What did I change:
- I changed arcsin/arccos/arctan to asin/acos/atan.
- the input (hypothenuse, adjacent side, opposite side, angle, opposite angle) are now for each possibility (selection) in
Hypotenuse1,adjacent side1,opposite side1,angle1,opposite angle1
or hypotenuse2,adjacent2,opposite2,angle2, oppositeangle2 or ... hypotenuse9,adjacent9,opposite9,angle9, oppositeangle9 converted.
- I moved the drawings to the "Macro" folder.

As mentioned, it works fine now. I think time will tell if more bugs pop up.

My next project:
Write the formulas for a general triangle without a right angle (90°) as ppm.

Thank you again for your helping hands.

Greetings Sauerkraut
#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

I was presuming Sauerkraut was using SD.
Doesn't matter what program you are using - the minus 1 to 1 rule applies to all programs even excel.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

Once you get the ppms working - you can make a "macro" version that can be used as a calculator in other ppms.
That would be very useful

something like this, but obviously more complicated, this is a useless example

//mini ppm saved as Sum in macro sub folder
//adds numbers
Units(1[mm]);
Input(num1,num2)

a = num1+num2

Output(a)

use it like this

a = 50
b = 150

c = Sum(a,b)





Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

I agree Nikki
Surkål should make macro's and use them in a main file if he want to make for all kind of triangles IMO
More easy to have control over what is what then.

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

sauerkraut2018

Hallo Nikki,

Post #37:
QuoteI was presuming Sauerkraut was using SD.
To write ppm I use Notepad++ as you suggested.
To test the ppm, I load the ppm into the Symbols- and Macro-directories and run them in Turbocad.

Post #37:
Zitat:
QuoteDoesn't matter what program you are using - the minus 1 to 1 rule applies to all programs even excel.
I think you want to tell me I should insert a test:
Input a, Input b, Input c

IF a>c , IF a>b, a=hypothenuse
IF b>a , IF b>c, b=hypothenuse
IF c>a , IF c>b, c=hypothenuse

Is it meant in this way?

Post #38:
QuoteOnce you get the ppms working - you can make a "macro" version that can be used as a Calculator in other ppms.

Is this a suggestion for a next project in ppm?
Writing a pocket calculator is definitely a challenge.  ;)


Hello Torfinn,

Post #39
I am working on it. I'm trying to solve the "general triangle" formulas using ppm and macroppm.

I want to thank you both again for your great help.
I'll get back to you if I have any questions.

#-----
Very low knowledge of English - I ask for indulgence - Thanks
Currently installed
TurboCAD Professional 32-bit V.17.2.77.1
TurboCAD 2016 ProPlatinum 64-bit V23.2-61.2 engl.
TurboCAD 2021 Platinum 64-bit V28.0 B.82.3 de.
#-----

nikkipollard

Or you can use something like this

v1 = 50
v2 = 100
hyp = max(v1,v2)
opp = min(v1,v2)
A = asin(opp/hyp)

When you make a mistake the program swaps the values and the sum always works.
The problem I find with ppms is it calculates every time you change a parameter, So even though you know the hypotenuse is larger then the side if you change one parameter before the other you might get an error. I try to avoid that. Once the sum is working you can choose what you want to do either use the fake value or display a message that your values aren't what you expected.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h