package Current.manage; import Current.basic.*; /** * This class represents a point in the Parameter space * when passed through the Manager. * @author pat */ public class Parameter { private Complex z; /** Creates a new instance of Parameter */ public Parameter(double x, double y) { z=new Complex(x,y); fix(); } /** Creates a new instance of Parameter */ public Parameter(Complex z) { this.z=new Complex(z.x,z.y); fix(); } public Parameter(RationalTriangle rt) { z=rt.toComplex(); fix(); } public double getX() { return z.x; } public double getY() { return z.y; } public Complex getZ() { return new Complex(z.x,z.y); } private void fix() { if (z.x<0) z.x=0; if (z.y<0) z.y=0; if (z.x>1) z.x=1; if (z.y>1) z.y=1; } public String toString() { return "("+z.x+", "+z.y+")"; } }