Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting started with 3D cardioid

648 views
Skip to first unread message

David Thomson

unread,
Aug 22, 2010, 8:14:03 AM8/22/10
to
I'm new to Mathematica, sorry. I would like to draw a cardioid
rotated about its polar axis. I checked the Mathematica wiki and it
did not cover this topic (that I could find). Can someone help me to
understand how to do this in Mathematica?

Dave

Bill Rowe

unread,
Aug 23, 2010, 2:37:42 AM8/23/10
to

To plot a basic cardioid:

ParametricPlot[{2 Cos[t] - Cos[2 t], 2 Sin[t] - Sin[2 t]}, {t, 0,
2 Pi}]

The same cardioid rotated 45 degrees counterclockwise about the origin

m = TransformationMatrix[RotationTransform[\[Pi]/4]][[;; 2, ;; 2]];
ParametricPlot[m.{2 Cos[t] - Cos[2 t], 2 Sin[t] - Sin[2 t]}, {t, 0,
2 Pi}]

The same cardioid rotated 45 degrees about the point {1,0}

m = TransformationMatrix[RotationTransform[\[Pi]/4, {1, 0}]][[;; 2]];
ParametricPlot[m.{2 Cos[t] - Cos[2 t], 2 Sin[t] - Sin[2 t], 1},
{t, 0,
2 Pi}]


Helen Read

unread,
Aug 23, 2010, 2:40:13 AM8/23/10
to

The thing to do is represent the cardioid parametrically.

For example, if you start with this cardioid:

r[t_] = 1 - Cos[t]

PolarPlot[r[t], {t, 0, 2 \[Pi]}]

Then express the polar curve parametrically, like so.

x[t_] = r[t] Cos[t];
y[t_] = r[t] Sin[t];

Note that due to symmetry, you need only revolve the top half (t from 0
to Pi) around the polar axis.

RevolutionPlot3D[{x[t], y[t]}, {t, 0, \[Pi]}, RevolutionAxis -> x]

--
Helen Read
University of Vermont

Alexei Boulbitch

unread,
Aug 24, 2010, 6:14:26 AM8/24/10
to
Hi, Dave,
try this:

SphericalPlot3D[
Cos[\[Theta]/2]^2, {\[Theta], 0, \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]},
ViewPoint -> {1, 0, -2}]

Have fun, Alexei

I'm new to Mathematica, sorry. I would like to draw a cardioid
rotated about its polar axis. I checked the Mathematica wiki and it
did not cover this topic (that I could find). Can someone help me to
understand how to do this in Mathematica?

Dave

--
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.b...@iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.


David Thomson

unread,
Aug 26, 2010, 6:47:35 AM8/26/10
to
On Aug 23, 1:40 am, Helen Read <h...@together.net> wrote:
> On 8/22/2010 8:14 AM,David Thomsonwrote:

Thank you, Helen. That worked beautifully. Not only did it produce
the 3D shape I was looking for, but also with the proper
proportions.

I tried to use a different geometry, but the parametric equation did
not give the results I was expecting.
r[t_] = t^-1 Sin[t + 1]


PolarPlot[r[t], {t, 0, 2 \[Pi]}]

In the above case, I'm looking for something with the appearance of a
horn.

Afterward, I want to learn how to position the cardioid origin on top
of the point of the horn. This is a project I am actually building
and would like to use Mathematica to model it so I can make
illustrations.

Dave

David Thomson

unread,
Aug 26, 2010, 6:47:46 AM8/26/10
to
On Aug 24, 5:14 am, Alexei Boulbitch <alexei.boulbi...@iee.lu> wrote:
> Hi, Dave,
> try this:
>
> SphericalPlot3D[
> Cos[\[Theta]/2]^2, {\[Theta], 0, \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]},
> ViewPoint -> {1, 0, -2}]
>
> Have fun, Alexei

Thanks Alexei,

The equation produces the geometry I am looking for. How would I
adjust the proportions such that the mean radius equals 1 instead of .
68?

Also, I tried to use this function with a different equation:

SphericalPlot3D[\[Theta]^-1 Sin[\[Theta] + 1], {\[Theta], 0,
2 \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]}, ViewPoint -> {1, 0, -2}]

but it did not produce the geometry I was looking for. I was hoping
to produce a horn shape (a 3D pulse).

Dave

Alexei Boulbitch

unread,
Aug 27, 2010, 4:08:06 AM8/27/10
to
Hi, David,

To answer your first question:
I do not understand, where the figure 68 for the average radius comes
from? Indeed, the radius of the 2D cardioid is r= Cos[\[Theta]/2]^2.
By averaging it over the angle theta one finds
1/\[Pi] Integrate[Cos[\[Theta]/2]^2, {\[Theta], 0, \[Pi]}]

1/2

If one instead averages it in 3D (e.g. over theta and phi) one gets

1/(4 \[Pi])
Integrate[


Cos[\[Theta]/2]^2, {\[Theta],

0, \[Pi]}, {\[CurlyPhi], -\[Pi], \[Pi]}]

\[Pi]/4

So you probably make the average in some different way. Anyway, if you
conclude that the result is 68 times larger than that you need,
why not to normalize the expression by 68? In other words
r = Cos[\[Theta]/2]^2/68;

Concerning your second question:

I am not aware of the horn shape and it would be helpful, if you post
the corresponding formula in whatever coordinates.
Nevertheless, looking at you function I have a feeling that you (a) have
written the first term of the product

\[Theta]^-1 Sin[\[Theta] + 1]

in a misleading way so that Mathematica interpret it incorrectly and
(b) use wrong limits for the angle Theta
(which typically varies between 0 and Pi). Try this:

SphericalPlot3D[
1/\[Theta] Sin[\[Theta] + 1], {\[Theta], 0, \[Pi]}, {\[CurlyPhi], 0,


2 \[Pi]}, ViewPoint -> {1, 0, -2}]

Finally, you can combine the two graphs by using Show. Like this, for
instance:

gr1 = SphericalPlot3D[
1/\[Theta] Sin[\[Theta] + 1], {\[Theta], 0, \[Pi]}, {\[CurlyPhi],
0, 2 \[Pi]}, ViewPoint -> {1, 0, -2},
PlotStyle -> Directive[Opacity[0.5]]];
gr2 = SphericalPlot3D[


Cos[\[Theta]/2]^2, {\[Theta], 0, \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]},

ViewPoint -> {1, 0, -2}];
Show[{gr1, gr2}]

I add the Opacity option to one of them to make visible the carioid
inside the pulse.

Have fun, Alexei

Thanks Alexei,

Dave


--
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.b...@iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.

__________ Information from ESET NOD32 Antivirus, version of virus signature database 5400 (20100826) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

David Thomson

unread,
Aug 29, 2010, 2:49:13 AM8/29/10
to
On Aug 27, 3:08 am, Alexei Boulbitch <alexei.boulbi...@iee.lu> wrote:
> Hi, David,
>
> To answer your first question:
> I do not understand, where the figure 68 for the average radius comes
> from?

The number is not 68, but decimal point 68. ie ".68".

> Concerning your second question:
>
> I am not aware of the horn shape and it would be helpful, if you post
> the corresponding formula in whatever coordinates.

My ignorance is to blame for providing incomplete information. The
shape I am trying to model is here"
http://www.secrets-of-the-aether.com/images/stories/idealtcshape-damped_wave.jpg

This shape comes from:
r[t_] = Sin[t + 1]/t
PolarPlot[r[t], {t, 0, \[Pi]}]

By trial and error, I got the graph about where it should be:

r[t_] = Sin[t + 1]/t^2;


x[t_] = r[t] Cos[t];
y[t_] = r[t] Sin[t];

RevolutionPlot3D[{x[t + 1], y[t - \[Pi]]}, {t, 0, 1},
RevolutionAxis -> x]

I tried the Show function to merge the above graph with the cardioid
graph, but got error messages. How do I merge the SphericalPlot3D
image with the RevolutionPlot3D image?

Thanks,

Dave

0 new messages