All pastes #534177 Raw Edit

Mine

public cpp v1 · immutable
·published 2007-06-03 18:14 UTC
rendered paste body
		double R1 = x;		cout << "R1: " << R1 << endl;		double R2 = r.getX ();		cout << "R2: " << R2 << endl;		double l1 = breite;		cout << "l1: " << l1 << endl;		double l2 = r.getBreite ();		cout << "l2: " << l2 << endl;		double d = 0;		if ((R1 + l1 <= R2) || (R1 >= (R2 + l2)))			cout << "keine Ueberschneidung in X" << endl;		else if (R1 == R2)			// Schnitt ist das Minimum aus beiden Breiten			d = min (l1, l2);		else if ((R1 >= R2) && ((R1 + l1) <= (R2 + l2)))			// Das Rechteck liegt innerhalb des anderen			d = l1;				else if ((R1 <= R2) && ((R1 + l1) >= (R2 + l2)))			// Das Rechteck überlagert das andere			d = l2;		else if ((R1 < R2) && ((R1 + l1) > R2))			// Rechteck ragt von links hinein			d = (R1 + l1) - R2;		else if ((R1 > R2) && ((R2 + l2) > R1))			// Rechteck ragt von rechts hinein			d = (R2 + l2) - R1;		cout << "Schnittmenge in X: " << d << endl;