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

Draw a circle in 3D

905 views
Skip to first unread message

ibmi...@hotmail.com

unread,
May 9, 2009, 12:17:36 AM5/9/09
to
Hi,

I would like to draw circles of radius 1 centered at the origin in 3d,
similar to (but not limited to) the longitude lines of the globe. That
is planes that lies in the a particular plane made an angle with the
one of the axes etc.

Is there any mathematica function to do this?

Many thanks in advance,

Michuco

David Park

unread,
May 9, 2009, 3:19:07 AM5/9/09
to
The Presentations package at my website ($50), among many other things, has
a Circle3D, and also Disk3D, routine.

Circle3D[position, normal, radius, anglerange] will draw a circle with the
specified position and radius. The orientation of the circle is given by the
normal vector.

Here is an example of its use, drawing two circles at different locations
with different colors and orientations, and also adding arrows at the center
to show the normals.

Draw3DItems[
{Opacity[0.8],
Lighter@Brown,
Circle3D[{0, 0, 0}, {0, 0, 1}, 2, Mesh -> {5, 10}],
Pink,
Circle3D[{2, 2, 2}, {2, 0, 2}, 1, Mesh -> None],
Green,
Arrow3D[{0, 0, 0}, {0, 0, 1}, {0.3}],
Arrow3D[{2, 2, 2}, {2, 2, 2} + Normalize[{2, 0, 2}], {0.3}]},
NeutralLighting[0, 0.5, 0.1],
PlotRange -> All,
Axes -> True,
ImageSize -> 400]

One method to obtain the circles without the package would be to parametrize
a 3D circle that lies in the xy-plane at the origin and then use Rotate[g,
{u, v}] to orient it in the desired direction. (And also use Translate if
you want it at some other location.)


David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/

Adriano Pascoletti

unread,
May 9, 2009, 3:22:51 AM5/9/09
to
Try

=E8 = 25*Degree;

Graphics3D[{Cylinder[{{0, 0, 0}, {0, 0, 0.001}}, 1],
Cylinder[{{0, 0, 0}, 0.001*{Cos[=E8], Sin[=E8], 0}}, 1]}]


Adriano Pascoletti

2009/5/8 ibmi...@hotmail.com <ibmi...@hotmail.com>

Szabolcs Horvát

unread,
May 9, 2009, 3:31:18 AM5/9/09
to
ibmi...@hotmail.com wrote:
> Hi,
>
> I would like to draw circles of radius 1 centered at the origin in 3d,
> similar to (but not limited to) the longitude lines of the globe. That
> is planes that lies in the a particular plane made an angle with the
> one of the axes etc.
>
> Is there any mathematica function to do this?
>

No, there isn't, but it's not difficult to write one using
ParametricPlot3D, or directly with Line, and then rotate it as you like.

Graphics3D[
Rotate[Line@
Table[{Cos[u], Sin[u], 0}, {u, 0., 2 Pi, 2 Pi/30}],
{{1, 0, 0}, {1, 0, 1}}]
]

0 new messages