There is something wrong if you are thedouble type minus an int type. Because when you are refer to a double type.
Eg. Double 1.0;
Some IDE may get the value 1.00000000000
and others may get 0.999999999999999
But They represent the same number.
The same problem here.
So your must find the precise position.
For that we use the function (x^2+y^2-1) ^3-x^2*y^3 = 0;
single Peach Heart:
public static void Main (String argv[]) {for
(float y = (float) 1.5;y>-1.5;y-=0.1)
{for
(float x= (float)-1 .5;x<1.5;x+= 0.05)
{
float a = x*x+y*y-1;
if ((a*a*a-x*x*y*y*y) <=0.0)
{
System.out.print ("*");
}
else
System.out.print ("");
}
System.out.print ("\ n");
}
For two of the pic
public static void Main (String argv[]) {for (Float y = (float) 1.5;y>-1.5;y-=0.1) {
for (float x= (float) -1.5;x<1.5;x+= 0.05) {float A = x*x+y*y-1; if ((a*a*a-x*x*y*y*y) <=0.0) {if (Math.Abs (x+0.100000712) <=1e-6 && Math.Abs (y-0.6999998) <=1e-6) {SYSTEM.OUT.P
Rint ("F");
Continue
if (Math.Abs (x+0.050000306) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("R");
Continue
if (Math.Abs (x+-3.0621885e-7) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{ System.out.print ("a");
Continue
if (Math.Abs (x-0.049999695) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("n");
Continue
if (Math.Abs (x-0.100000001) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("K");
Continue
} System.out.print ("*");
else System.out.print (""); for (float x= (float) 1.5;x<4.5;x+= 0.05) {float A = (x-3) * (x-3) +y*y-1;
Boolean flag = false; if ((a*a*a-(x-3) * (x-3) *y*y*y) <=0.0) {if (Math.Abs (x-3+0.100000712) <=1 E-6 && Math.Abs (y-0.6999998) <=1e-6) {System.ou
T.print ("C");
Flag = true;
Continue
} if ((Math.Abs (x-2.9499986)) <= 1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("a");
Continue
if (Math.Abs (x-2.9999986) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("s");
Continueif (Math.Abs (x-3.0499985) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("I");
Continue
if (Math.Abs (x-3.0999985) <=1e-6 && math.abs (y-0.6999998) <=1e-6)
{System.out.print ("O");
Continue
} System.out.print ("*");
else System.out.print ("");
} System.out.print ("\ n");
}
}