Zum Inhalt springen

Stampi

Mitglieder
  • Gesamte Inhalte

    9
  • Benutzer seit

  • Letzter Besuch

  1. Ok, danke, ist auch möglich. Hatte das Problem nämlich auch schon öfters, dass eine Compilermeldung kam, wenn keine Klammern gesetzt wurden. Obwohl das in anderen Sprachen (Java, C++) ziemlich egal ist.
  2. So Leute, danke nochmal für alles. Es funktioniert jetzt. Bin draufgekommen, dass bei der Fallunterscheidung alpha<0 oder >0 etwas nicht stimmte. Danke für eure zahlreichen Antworten!! Hier der richtige Code: `$1...x1 `$2...y1 `$3...x2 `$4...y2 `$5...x3 `$6...y3 `$7...x4 `$8...y4 `$9...Winkelverschiebung um alpha(-180°-180°) C_REAL($1;$2;$3;$4;$5;$6;$7;$8;$9) C_REAL($x_1;$x_2;$x_3;$x_4;$y_1;$y_2;$y_3;$y_4) C_REAL($alpha) $alpha:=$9*Degree If (($alpha=0) | ($9=180) | ($9=(-180))) $x_1:=$1 $y_1:=$2 $x_2:=$3 $y_2:=$4 $x_3:=$5 $y_3:=$6 $x_4:=$7 $y_4:=$8 Else If ($9<0) $alpha:=$alpha*(-1) $x_1:=($1*Cos($alpha))+($2*Sin($alpha)) $x_2:=($3*Cos($alpha))+($4*Sin($alpha)) $x_3:=($5*Cos($alpha))+($6*Sin($alpha)) $x_4:=($7*Cos($alpha))+($8*Sin($alpha)) $y_1:=(-$1*Sin($alpha))+($2*Cos($alpha)) $y_2:=(-$3*Sin($alpha))+($4*Cos($alpha)) $y_3:=(-$5*Sin($alpha))+($6*Cos($alpha)) $y_4:=(-$7*Sin($alpha))+($8*Cos($alpha)) Else $x_1:=($1*Cos($alpha))+($2*Sin($alpha)) $x_2:=($3*Cos($alpha))+($4*Sin($alpha)) $x_3:=($5*Cos($alpha))+($6*Sin($alpha)) $x_4:=($7*Cos($alpha))+($8*Sin($alpha)) $y_1:=(-$1*Sin($alpha))+($2*Cos($alpha)) $y_2:=(-$3*Sin($alpha))+($4*Cos($alpha)) $y_3:=(-$5*Sin($alpha))+($6*Cos($alpha)) $y_4:=(-$7*Sin($alpha))+($8*Cos($alpha)) End if End if ARRAY INTEGER(koord;8) koord{1}:=$x_1 koord{2}:=$y_1 koord{3}:=$x_2 koord{4}:=$y_2 koord{5}:=$x_3 koord{6}:=$y_3 koord{7}:=$x_4 koord{8}:=$y_4 $0:=koord
  3. Sry, nicht in Radiant, sondern im Bogenmaß
  4. Naja, hab bei den Winkelfunktionen in 4th Dimension nachgeschaut, und angeblich benötigen diese Funktionen die Winkelangabe in Radiant und die Umrechnung dafür ist "Winkel*Degree". Sprich Degree ist eine Konstante.
  5. So danke mal für die Antwort. Also selbe Parameter wie vorher, folgende Werte: alpha=0,3490658503988658956 Sin(alpha)=0,3420201433256687129 Cos(alpha=0,9396926207859 $1*Cos(alpha)=23,49231551964771114 $2*Sin(alpha)=17,10100716628343420
  6. Also danke, für die Antwort. Also bei den Parametern: AbmA=20 AbmB=10 Alpha=20 Grad ergeben sich in folgenden Variablen die Werte: links=25 oben=50 laenge=100 breite=50 koord{1}=-25 koord{2}=55 koord{3}=-57 koord{4}=87 koord{5}=-74 koord{6}=134 koord{7}=-42 koord{8}=102
  7. Das ist der Code, der das ganze zeichnet. Die Funktion "PROJ_AssistentWinkelVersch" ist jener Code denn ich oben gepostet habe. C_REAL($1;$2) C_REAL($ges) C_INTEGER($3) $CTOffscr:=CT New offscreen area CT SET DOCUMENT SIZE ($CTOffscr;300;350) $ges:=$1+$2 $laenge:=(150/$ges)*$1 $breite:=(150/$ges)*$2 $links:=(150-$laenge)/2 $oben:=(150-$breite)/2 ARRAY INTEGER(koord;8) koord:=PROJ_AssistentWinkelVersch ($links;$oben;$links+$laenge;$oben;$links+$laenge;$oben+$breite;$links;$oben+$breite;$3) ARRAY INTEGER(koordX;5) ARRAY INTEGER(koordY;5) For ($i;1;8) koord{$i}:=koord{$i}+150 End for koordX{1}:=koord{1} koordX{2}:=koord{3} koordX{3}:=koord{5} koordX{4}:=koord{7} koordY{1}:=koord{2} koordY{2}:=koord{4} koordY{3}:=koord{6} koordY{4}:=koord{8} koordX{5}:=koordX{1} koordY{5}:=koordY{1} $0:=CT Array to polygon ($CTOffscr;koordX;koordY) $pict:=CT Area to picture ($CTOffscr;-2) [Projekt];"ProjektAssistent"PictFormLage:=$pict CT DELETE OFFSCREEN AREA ($CTOffscr)
  8. So, danke mal für die Antworten. 1. Habe jetzt das mit den Vorzeichen geändert, funktioniert leider doch nicht 2. Das mit der Unterscheidung muss noch gemacht werden, macht aber erst Sinn wenn es auch so funktioniert `$1...x1 `$2...y1 `$3...x2 `$4...y2 `$5...x3 `$6...y3 `$7...x4 `$8...y4 `$9...Winkelverschiebung um alpha(-180°-180°) C_REAL($1;$2;$3;$4;$5;$6;$7;$8;$9) C_REAL($x_1;$x_2;$x_3;$x_4;$y_1;$y_2;$y_3;$y_4) `C_INTEGER($M_x;$M_y) `C_INTEGER($x1;$x2;$x3;$x4;$y1;$y2;$y3;$y4) C_REAL($alpha) $alpha:=$9*Degree If (($alpha=0) | ($9=180) | ($9=(-180))) $x_1:=$1 $y_1:=$2 $x_2:=$3 $y_2:=$4 $x_3:=$5 $y_3:=$6 $x_4:=$7 $y_4:=$8 Else If ($9<0) $x_1:=$1*Cos($alpha)+$2*Sin($alpha) $x_2:=$3*Cos($alpha)+$4*Sin($alpha) $x_3:=$5*Cos($alpha)+$6*Sin($alpha) $x_4:=$7*Cos($alpha)+$8*Sin($alpha) $y_1:=-$1*Sin($alpha)+$2*Cos($alpha) $y_2:=-$3*Sin($alpha)+$4*Cos($alpha) $y_3:=-$5*Sin($alpha)+$6*Cos($alpha) $y_4:=-$7*Sin($alpha)+$8*Cos($alpha) Else $alpha:=$alpha*(-1) $x_1:=$1*Cos($alpha)+$2*Sin($alpha) $x_2:=$3*Cos($alpha)+$4*Sin($alpha) $x_3:=$5*Cos($alpha)+$6*Sin($alpha) $x_4:=$7*Cos($alpha)+$8*Sin($alpha) $y_1:=-$1*Sin($alpha)+$2*Cos($alpha) $y_2:=-$3*Sin($alpha)+$4*Cos($alpha) $y_3:=-$5*Sin($alpha)+$6*Cos($alpha) $y_4:=-$7*Sin($alpha)+$8*Cos($alpha) End if End if ARRAY INTEGER(koord;8) koord{1}:=$x_1 koord{2}:=$y_1 koord{3}:=$x_2 koord{4}:=$y_2 koord{5}:=$x_3 koord{6}:=$y_3 koord{7}:=$x_4 koord{8}:=$y_4 $0:=koord Und so sieht das ganze dann aus [ATTACH]1811[/ATTACH]
  9. Ich arbeite an einem bauphysikalischen Programm zur Berechnung des Heizwärmebedarfs von Gebäuden. Das Hauptproblem liegt bei mir darin, dass in einer kleinen Vorschauskizze die rechteckige Grundfläche eines Hauses (a, im richtigen Verhältnis gezeichnet werden soll. Dadurch, dass ein Computerbildschirm in einzelne Bildpunkte geteilt ist, kann man sich das ganze als Kartesisches Koordinatensystem vorstellen. Die Vorschau mit einem normalen Rechteck funktioniert bereits jedoch habe ich ein Problem damit, dass man auch einen Winkel alpha festlegen kann, der die Abweichung des Grundstückes von Norden angibt, sprich das Rechteck soll im Koordinatensystem entsprechend dem Winkel alpha gedreht werden. Das Problem, dass ich jetzt habe, ist, dass ich nicht genau weiß wie ich die Koordinaten der Punkte (A, B, C, D) des gedrehten Rechteckes ermitteln kann. Ich habe zwar schon probiert, das Problem mit Vektoren bzw. Matrizen zu lösen, bis jetzt aber ohne Erfolg. `$1...x1 `$2...y1 `$3...x2 `$4...y2 `$5...x3 `$6...y3 `$7...x4 `$8...y4 `$9...Winkelverschiebung um alpha(-180°-180°) C_REAL($1;$2;$3;$4;$5;$6;$7;$8;$9) C_REAL($x_1;$x_2;$x_3;$x_4;$y_1;$y_2;$y_3;$y_4) `C_INTEGER($M_x;$M_y) `C_INTEGER($x1;$x2;$x3;$x4;$y1;$y2;$y3;$y4) C_REAL($alpha) $alpha:=$9*Degree If (($alpha=0) | ($9=180) | ($9=(-180))) $x_1:=$1 $y_1:=$2 $x_2:=$3 $y_2:=$4 $x_3:=$5 $y_3:=$6 $x_4:=$7 $y_4:=$8 Else If ($9<0) $x_1:=$1*Cos($alpha)-$2*Sin($alpha) $x_2:=$3*Cos($alpha)-$4*Sin($alpha) $x_3:=$5*Cos($alpha)-$6*Sin($alpha) $x_4:=$7*Cos($alpha)-$8*Sin($alpha) $y_1:=$1*Sin($alpha)+$2*Cos($alpha) $y_2:=$3*Sin($alpha)+$4*Cos($alpha) $y_3:=$5*Sin($alpha)+$6*Cos($alpha) $y_4:=$7*Sin($alpha)+$8*Cos($alpha) Else $alpha:=$alpha*(-1) $x_1:=$1*Cos($alpha)-$2*Sin($alpha) $x_2:=$3*Cos($alpha)-$4*Sin($alpha) $x_3:=$5*Cos($alpha)-$6*Sin($alpha) $x_4:=$7*Cos($alpha)-$8*Sin($alpha) $y_1:=$1*Sin($alpha)+$2*Cos($alpha) $y_2:=$3*Sin($alpha)+$4*Cos($alpha) $y_3:=$5*Sin($alpha)+$6*Cos($alpha) $y_4:=$7*Sin($alpha)+$8*Cos($alpha) End if End if ARRAY INTEGER(koord;8) koord{1}:=$x_1 koord{2}:=$y_1 koord{3}:=$x_2 koord{4}:=$y_2 koord{5}:=$x_3 koord{6}:=$y_3 koord{7}:=$x_4 koord{8}:=$y_4 $0:=koord Das Problem ist aber, dass die Vorschau so aussieht:

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...