/*
Batch file for Maxima CAS
save as a o.mac
run maxima :
maxima
and then :
batch("a.mac");
*/
kill(all);
remvalue(all);
ratprint:false; /* It doesn't change the computing, just the warnings. */
display2d:false;
numer: true;
/*
http://mathworld.wolfram.com/Rose.html
r = a* sin(n*t)
If n is odd, the rose is n-petalled.
If n is even, the rose is 2n-petalled.
If n=r/s is a rational number, then the curve closes at a polar angle of theta=pi*s*p, where
p=1 if r*s is odd
p=2 if r*s is even.
If n is irrational, then there are an infinite number of petals.
*/
RoseCurve_Polar(n, a):=
/* polar(radius, ang, minang, maxang) */
polar(a*sin(n*t),t,0,2*%pi)$
/*
https://commons.wikimedia.org/wiki/File:Two_3_Petal_roses.png
*/
RoseCurves_Polar(n, aMin, aMax, aStep):= block(
[a,l, ll],
ll:[],
for a:aMin step aStep thru aMax do (
l:RoseCurve_Polar(n,a),
ll: cons(l,ll),
l:RoseCurve_Polar(n,-a), /* mirror symmmetry */
ll: cons(l,ll)
),
return (ll)
)$
n:3;
ll:RoseCurves_Polar(n, 1, 20,0.5)$
load(draw);
/* strings */
path:"~/c/julia/parabolic/hawaian/6/"$ /* if empty then file is in a home dir , path should end with "/" */
FileName: string(n)$
draw2d(
terminal = svg,
file_name = sconcat(path, FileName,""),
title = "",
dimensions = [1000, 1000],
nticks=300,
ll)$
/* https://math.stackexchange.com/questions/104163/writing-a-polar-equation-for-the-graph-of-an-implicit-cartesian-equation
l:polar(abs(sin(2*t))^(1/3),t,0,2*%pi);
ll: cons(l,ll);
l:polar(abs(sin(2*t)),t,0,2*%pi);
ll: cons(l,ll);
ll:[];
draw2d(nticks=300,ll);
*/