0 Daumen
124 Aufrufe

Frage:

blob.png

Text erkannt:

circle. Radius \( =10 * \) Math. Sqrt(2);
otherCircle. \( X=15 ; \)
otherCircle.Y \( =15 ; / / 45 \) Grad
otherCircle. Radius \( =4 * \) Math. Sqrt(2);
Assert. IsFalse(circle. Is0verlappingWith(otherCircle), "Abstand bei 45 Grad");
otherCircle. Radius \( =5 * \) Math. Sqrt(2);
Assert. IsTrue(circle. Is0verlappingWith(otherCircle), "Berührung bei 45 Grad");
otherCircle. Radius \( =6 * \) Math.Sqrt(2);
Assert. IsTrue(circle. Is0verlappingWith(otherCircle), "Überlagerung bei 45 Grad");

Hey Leute, das ist eine fertige Unittest Methode, und ich muss dazu eine Richtige Methode schreiben.

  public bool IsOverlappingWith(Circle otherCircle) {}

Circel = Meine Klasse

X, Y, Radius sind Member Variablen

blob.png

Text erkannt:

#region Fields
private double _xi
private double \( -\mathbf{y}_{i} i \)
private double _radius;
#endregion

Und meine Frage lautet, was muss ich genau in meine Methode berechnen bzw. was zurück geben?

Abstand bei 45 Grad ist (false)

Berührung bei 45 Grad ist (true)

Überlagerung bei 45 Grad ist (true)

Was könnte damit gemeint sein, wenn ich mir zwei Kreise vorstelle?


Code:

Avatar von

Ein anderes Problem?

Stell deine Frage

Willkommen bei der Stacklounge! Stell deine Frage einfach und kostenlos

x
Made by a lovely community