(* Copyright 1993 Alfred Gray *)

BeginPackage["PCURVES2D`","Graphics`Graphics`"]

    archimedesspiralpolar::usage="theta->archimedesspiralpolar[n,a][theta]
 is the polar form of the spiral of Archimedes of radius a and index n."

    cardioidpolar::usage="theta->cardioidpolar[a][theta] is the
polar form of the heart-shaped curve that is traced by a point
on the circumference of a circle rolling completely around a
fixed circle of the same radius."

    cochleoidpolar::usage="theta->cochleoidpolar[n,b][theta] is
the polar form of the curve whose parametrized form is
t->a*(Sin[t]/t)^n*{Cos[t],Sin[t]}."

    fermatspiralpolar::usage="theta->fermatspiralpolar[a][theta] is
the polar form of the spiral of Fermat. a may be positive or negative."

    foliumpolar::usage="theta->foliumpolar[theta] is
the polar form of the folium of Descartes. The nonparametric form is
x^3 + y^3 - 3*x*y==0."

    hyperbolicspiralpolar::usage="theta->hyperbolicspiralpolar[a][theta]
is the polar form of the hyperbolic spiral of radius a.
It is a special case of the spiral of Archimedes."

    limaconpolar::usage="theta->limaconpolar[a,b][theta] is
the polar form of the curve whose implicit equation is
(x^2 + y^2 - 2*a*x)^2==b^2*(x^2 + y^2)."

    lituuspolar::usage="theta->lituuspolar[a][theta] is
the polar form of the lituus spiral of radius a."

    logspiralpolar::usage="theta->logspiralpolar[a,b][theta] is
the polar form of the logspiral of radius a and slant b."

    pacman::usage="theta->pacman[n][theta] is the polar form of a
pacman shaped curve of degree n."

    rosepolar::usage="theta->rosepolar[n,a][theta] is
the polar form of a rose of radius a with n petals if n is odd
and 2n petals if n is even."

Begin["`Private`"]

    archimedesspiralpolar[n_,a_][theta_]:=a*theta^(1/n)

    cardioidpolar[a_][theta_]:=2*a*(1 + Cos[theta])

    cochleoidpolar[n_,a_][theta_]:=a*(Sin[theta]/theta)^n

    fermatspiralpolar[a_][theta_]:= a*(theta)^(1/2)

    foliumpolar[theta_]:=
         3*Cos[theta]*Sin[theta]/(Cos[theta]^3 + Sin[theta]^3)

    hyperbolicspiralpolar[a_][theta_]:=a/theta

    limaconpolar[a_,b_][theta_]:= 2*a*Cos[theta] + b

    limaconpolar[n_,a_,b_][theta_]:= 2*a*Cos[n*theta] + b

    lituuspolar[a_][theta_]:= a*(theta)^(-1/2)

    logspiralpolar[a_,b_][theta_]:=a*E^(b*theta)

    pacman[n_][theta_]:=Cos[theta]^n+1

    rosepolar[n_,a_][theta_]:=a*Cos[n*theta]


End[]

EndPackage[]