Although the equation you have does describe a heart shape (mathematically) it is not in a form that can easily be computed. The solution is to look for a pair of parametric formulae that describe a heart shape. After a little googling I found these
x = 16 * sin^3(t)
y = 13cos(t) - 5 * cos(2t) -2cos(3t) - cos(4*t)
and t varies in the range >= -PI and <= PI
any way so I created this sketch which using these formulae
There is an alternative to using parametric equations and that is using polar coordinates where a position is defined by the distance from the origin (r) and the angle made with the x axis (t). This heart was drawn with the equation
Comments
in my understanding you have to get rid of the zero and re-formulate your formula to something like
y = .......................x.......x....................
when you have that just for-loop through 0 to 1000 and calculate and display all the y-values for the current x-value....
my own naive approach needs two minutes and has no result
Although the equation you have does describe a heart shape (mathematically) it is not in a form that can easily be computed. The solution is to look for a pair of parametric formulae that describe a heart shape. After a little googling I found these
x = 16 * sin^3(t)
y = 13cos(t) - 5 * cos(2t) -2cos(3t) - cos(4*t)
and t varies in the range >= -PI and <= PI
any way so I created this sketch which using these formulae
1st time posting in the new forum.
Still no avatar and dunno whether code is gonna be formatted yet.
Anyways, here it is a slightly modified code. 8-X
There is an alternative to using parametric equations and that is using polar coordinates where a position is defined by the distance from the origin (r) and the angle made with the x axis (t). This heart was drawn with the equation
r = (sin(t) * sqrt(abs(cos(t))))/(sin(t) + 1.4) - 2*sin(t) + 2;
where again t goes from -PI to +PI
and then converting the polar to Cartesian coordinates
Thanks to everyone who helped! The solution from quark works perfectly! 8->