/**/ use QQ[x,y,z];
/**/ L := [x^3-y^2+z-1, x-2, (y-3)*(y+2)];
/**/ RationalSolve(L);
record[AffinePts := [[2, -2, -3], [2, 3, 2]], indets = [x,y,z]]
/**/ ApproxSolve(L);
record[AffinePts := [[2, -2, -3], [2, 3, 2]], indets = [x,y,z]]
/**/ L := [x^3-y^2+z-1, x^2-2, (y-3)*(y+2)];
/**/ AS := ApproxSolve(L);
--> use FloatStr or DecimalStr to make result more readable
/**/ indent([[ FloatStr(coord) | coord in pt] | pt in AS.AffinePts]);
[
["1.4142", "-2.0000", "2.1716"],
["-1.4142", "-2.0000", "7.8284"],
["1.4142", "3.0000", "7.1716"],
["-1.4142", "3.0000", "12.828"]
]
-- Verify we have an approximate answer:
/**/ indent([ [ FloatStr(eval(f, pt)) | f in L ] | pt in AS.AffinePts]);
[
["7.1576*10^(-19)", "5.0612*10^(-19)", "0.0000"],
["-7.1576*10^(-19)", "5.0612*10^(-19)", "0.0000"],
["2.8208*10^(-19)", "1.9946*10^(-19)", "0.0000"],
["-2.8208*10^(-19)", "1.9946*10^(-19)", "0.0000"]
]
|