Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 03.01.03 23:59 
huhu :)

mal wieder ein MatheProblem...
user defined image

Ich habe die X und Y-Koordinaten beider Kreise, sowie den Winkel in dem Kreis2 auf Kreis1 zukommt... wie errechne ich nun den winkel in dem Kreis2 abprallt??? (Kreis1 steht fest)

Au'revoir,
Aya~

PS: Bitte nicht einfach nur sagen "Einfallswinkel = Ausfallswinkel" das weiß ich auch... nur ich bräuchte mal genauere formeln... zumal Kreis2 in jedem beliebigen winkel ankommen kann, und Kreis1 an jeder beliebigen stelle treffen kann..
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Sa 04.01.03 03:29 
Hallo,

zu erst einmal musst du den Aufprallpunkt berechnen. Das dürfte ja kein Problem sein.
Dann denkst du dir eine Gerade (g1) zwischen dem Mittelpunkt des Kreises 1 (der feste) und dem Aufprallpunkt.
Dann denkst du dir eine andere Gerade (g2) zwischen dem Mittelpunkt des Kreises 2 (der bewegte) und dem Aufprallpunkt.
Anschließend brauchst du nur noch den Schnittwinkel dieser beiden Geraden berechnen. Das ist dann der Einfallwinkel (a) und auch der Ausfallwinkel.

Skizze:
user defined image

Ich hoffe mal, dass dir das weiterhilft. :wink:

_________________
If accidentally read, induce vomitting.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 04.01.03 06:01 
Hm. Aya, was war denn das jetzt? Genauso habe ich es dir doch auch im ICQ erklärt, nur das ich mit der Tangente an Kreis 1 und dem Auftreffpunkt gearbeitet haben. Was, wie mir jetzt klar wird, überflüssig war.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 18:28 
ich habe auch das problem:
ich will testen ob 2 Greiße(image Kompos) zusammen gestoßen sind aber wie ?

MFG
mimi
delphist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WIN XP, 98, 95; SUSE LINUX 8.1, 6.1, 6.0

BeitragVerfasst: Sa 04.01.03 18:50 
mimi hat folgendes geschrieben:
ich habe auch das problem:
ich will testen ob 2 Greiße(image Kompos) zusammen gestoßen sind aber wie ?

MFG
mimi

Greiße gibt es nicht!
Es gibt nur Kreise und Greise!
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 18:55 
dann habe ich mich veschrieben aber wie mache ich das nun ?
also wie teste ich habe zwei Kreise zusammengestoßen sind ?

MFG
mimi
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 20:12 
@Ex0rcist: Mh... das es so geht weiß ich, nur bei mir komm tjedesmal was anderes raus...

Sag mir doch bitte mal ne genaue Formel... :)

@Luckie: Ja, es is genauso wie du erklärt hast.. nur wie gesagt klappt es bei mir net :(

*winkt*
Aya~
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 20:15 
@Mimi: geht einfach.. :)

Du brauchst nur die Position des Kreises und den Radius...
dann rechnest du mit dem Satz des Pythagoras:

Sqrt(Sqr(X2 - X1) + Sqr(Y2 - Y1))

Wenn das dann kleiner ist als R1 + R2 dann treffen sich die beiden kreise.

Au'revoir,
Aya~
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 21:50 
Verstehe ich nicht: kannst du mal ein beispiel als funktion machen die funktion soll dann ein Bool wert zurückgeben.
Danke
und könntes du mir genauer sagen was Sqrt macht ?
weil ich kenn mich in Mahte leider nicht gut aus *heuel*

MFG
mimi
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 22:32 
huhu,

Sqrt = Wurzel
Sqr = Quadrat (^2)

Beispiel:
ausblenden Quelltext
1:
2:
3:
4:
function Collision(X1, Y1, X2, Y2: Integer; R1, R2: Single): Boolean;
begin
  Result:=Sqrt(Sqr(X2 - X1) + Sqr(Y2 - Y1))<R1 + R2;
end;


Au'revoir,
Aya~
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 22:34 
Danke !!
werde ich mal teste.
was muss ich als r angeben ?
radios ?
und wie bekomme ich denn raus ?

MFG
mimi
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 22:36 
huhu,

R ist Radius, ja...

Wie du den rausbekommst..? Öh... kommt drauf an wie du den kreis zeichnest...

schau mal im MatheBuch :)
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 04.01.03 22:37 
Titel: Funktion
Hallo!

sqrt zieht die 2. Wurzel (sqrt(9)=3)
sqr gibt dir das Quadrat (sqr(3)=9)

wenn AYA's Angaben richtig sind (wovon iuch ausgehe), dann könnte eine Funktion so aussehen:

ausblenden Quelltext
1:
2:
3:
4:
function kreiskollision(x1,y1,x2,y2,r1,r2:Integer):boolean;
begin
if Sqrt(Sqr(X2 - X1) + Sqr(Y2 - Y1)) <(r1+r2) then result:=true else result:=false;
end;

8)

Fiji-Fighter
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 04.01.03 22:39 
Titel: OOps
:oops: :oops: :oops:

Da war wer schneller :P :oops: :evil:

na ja egal

Fiji-Fighter
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 22:39 
ha!

ich war schneller *g*
und vorallem is meine Funktion kürzer, optimierter ;)
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 22:43 
ich habe leider kein mahte buch das so schlau ist :cry:
deshlab: könnte ihr mir vieleicht sagen wie ich zu r komme.
ich weiß nur das ich denn durchmesser durch 2 teilen muss mehr nicht.
Aber wie komme ich an denn durchmesser ?
fragen über Fragen ;)

MFG
mimi
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 22:44 
Aber.. mal davon abgesehen, mein Hauptproblem is immernoch da :)
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 04.01.03 22:45 
meins auch ;)

MFG
mimi
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 04.01.03 22:45 
Wie zeichnest du denn einen Kreis, wenn du keinen Radius weißt...?

Was weißt du denn alles von deinem Kreis? (Koordinaten oder so?)
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 04.01.03 22:53 
Titel: Buhuuu
:crying: :bawling:

Mein Code ist schlecht

:crying: :bawling:

Ich schreibe in Foren immer unoptimierten Code damit ich gegenüber anderen Programmierern evtl. immer einen Vorteil habe :wink: :wink:

Hast du ein 3/86 oder warum meinst du eine halbe Zeile weniger wäre schon optimiert???

Ich jedenfalls habe einen 4/86 *stolz sein* {gibt es so etwas überhaupt???}
und der ist voll schnell, so dass ich voll viel Datenmüll schreiben kann der gar nicht in der Geschwindigkeit auffällt!!! :twisted: :wink: :wink:


Na gut...
Dein Code ist besser.

Fiji-Fighter

P.S. -Meine Codes sind meistens 3-mal so lang wie die von anderen, dann war dass jetzt doch gar nicht so schlecht... :wink: :wink: