A very interesting mathematical recreation is to conceive coherent drawings using algebraic functions. Bezier curves are the authentic way to generate such computer graphics. Bezier came up with his genius in early 60s while designing automobile parts. Other popular means are Hermite curves and Splines.
Though effective, these means are involved and computationally demanding. However, sometimes by providence we do have sensible shapes made out from simple functions.
PLOTTING THE HEART IN MATLAB
I discuss plotting a heart using simple cardioid, polar plots and algebraic equations
(a) The simplest one
The simplest 'heart curve' is the cardioid. It is not truly a heart, however it looks somewhat similar to one.
(b) Polar plot
A polar curve given by;
gives a near perfect heart !
The Matlab command line is;
>> ezpolar('((sin(t)*sqrt(abs(cos(t))))*(sin(t) + (7/5))^(-1)) - 2*sin(t) + 2')
(c) Algebraic Equation
A heart can be made from the implicit algebraic function,
However tinkering by adding a factor of (0.35) and (1.3) to the terms makes the heart more aesthetic.
The Matlab command is,
>> ezplot('(0.35)*((x^2 + y^2 - 1)^3) - (1.3)*(x^2)*(y^3)');
It is worth noting that for using ezplot t, x and y doesn't have to be defined.
.
.
.
...then again forget MATLAB, we do have <3 to our rescue !
REFERENCES
(1) ezplot
(2) stackoverflow question 2720180
(3) stackoverflow question 323584
(4) Heart Curve page
(5) Wolfram page
(6) Bezier Heart in Gimp
Though effective, these means are involved and computationally demanding. However, sometimes by providence we do have sensible shapes made out from simple functions.
PLOTTING THE HEART IN MATLAB
I discuss plotting a heart using simple cardioid, polar plots and algebraic equations
(a) The simplest one
The simplest 'heart curve' is the cardioid. It is not truly a heart, however it looks somewhat similar to one.
(b) Polar plot
A polar curve given by;
gives a near perfect heart !
The Matlab command line is;
>> ezpolar('((sin(t)*sqrt(abs(cos(t))))*(sin(t) + (7/5))^(-1)) - 2*sin(t) + 2')
(c) Algebraic Equation
A heart can be made from the implicit algebraic function,
However tinkering by adding a factor of (0.35) and (1.3) to the terms makes the heart more aesthetic.
The Matlab command is,
>> ezplot('(0.35)*((x^2 + y^2 - 1)^3) - (1.3)*(x^2)*(y^3)');
It is worth noting that for using ezplot t, x and y doesn't have to be defined.
.
.
.
...then again forget MATLAB, we do have <3 to our rescue !
REFERENCES
(1) ezplot
(2) stackoverflow question 2720180
(3) stackoverflow question 323584
(4) Heart Curve page
(5) Wolfram page
(6) Bezier Heart in Gimp
0 comments:
Post a Comment