Nun ja,

das mit X und Y tauschen schaue ich mir mal an:
Hier der Teilausschnitt des Code:

Code:
	DeltaX = EndPosition.x - StartPosition.x;					// Berechne Differenz zum Ziel
	DeltaY = EndPosition.y - StartPosition.y;					// 
	if ( DeltaY == 0.0 && DeltaX == 0.0 )
		RotationAngle = 0.0;
	else
		{
		RotationAngle = atan2( DeltaY , DeltaX ); 				// Berechne kürzesten Winkel in WinkelWert
//		RotationAngle = fmod( (RotationAngle - BaseOrientation) , (ZWEI_PI));
		}

	if ( RotationAngle != 0.0 )																// Ist die Ausrichtung o.k.
		{
		TargetOrientation	= BaseOrientation +  RotationAngle; 		// Winkeldifferenz ermitteln
		TargetOrientation= AjustToTwoPI(TargetOrientation );			// Anpassung an Vollkreis
		RotationPulse = (int) (RotationAngle / RADPROIMPULS);	// Endcoder Impulse der Strecke
		}
	else
		{
		TargetOrientation = BaseOrientation;					// Ausrichtung hat sich nicht geändert
		RotationPulse=0;												// Keine Drehung notwendig. Ausrichtung korrekt
		}
Gruss Ritchie