// ===========================================================================//	ChossatGolubitskyChaos.java	1996 Yushin Hozumi All rights reserved.//									Author:Yushin Hozumi// ===========================================================================package	StudioRAIN.chaos;import StudioRAIN.geometry.*;import StudioRAIN.chaos.*;public class ChossatGolubitskyChaos implements ChaosGenerator2D{	float a, b, c, d;		public ChossatGolubitskyChaos( float inA, float inB, float inC, float inD )	{		a = inA;		b = inB;		c = inC;		d = inD;	}	public Vector2D transform( Vector2D inVector )	{		float theX = inVector.getX();		float theY = inVector.getY();		float theX2 = theX * theX;		float theY2 = theY * theY;				float theA = a * ( theX2 + theY2 ) + b * theX * ( theX2 - 3.0F * theY2 ) + c;		return new Vector2D		(			theA * theX + d * ( theX2 - theY2 ),			theA * theY - 2.0F * d * theX * theY		);	}	public String getScript()	{		return 			"A = ( " + Float.toString( a ) + " ) * ( x(n) * x(n) + y(n) * y(n) ) + ( " + Float.toString( b ) + " ) * x(n) * ( x(n) * x(n) - 3 * y(n) * y(n) ) + ( " + Float.toString( c ) + " )\n" +			"x(n+1) = A * x(n) + ( " + Float.toString( d ) + " ) * ( x(n) * x(n) - y(n) * y(n) )\n" +			"y(n+1) = A * y(n) - 2 * ( " + Float.toString( d ) + " ) * x(n) * y(n)\n";	}}