MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A question about location of points on a circle

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106935] Re: [mg106917] A question about location of points on a circle
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 29 Jan 2010 07:44:19 -0500 (EST)
  • References: <13046161.1264665699463.JavaMail.root@n11>

What do you mean by "locate"? Do you mean that you want to place some points
on the circle? Or do you mean that there are already some points on the
circle and you want to find their positions.

Here is a way to draw points on the circle. (We do need a specific radius
for the circle, which I take as 1.)

pointOnCircle[\[Theta]_] := {Red, AbsolutePointSize[6], 
  Point[{Cos[\[Theta]], Sin[\[Theta]]}]}
Graphics[
 {Circle[{0, 0}, 1],
  pointOnCircle[0],
  pointOnCircle[45 Degree],
  pointOnCircle[135 Degree]}]

For those who have the Presentations package we can specify the points as
complex numbers and get nicer looking points with less effort.

Needs["Presentations`Master`"]

Draw2D[
 {ComplexCircle[0, 1],
  ComplexCirclePoint[Exp[0], 4, Black, Red],
  ComplexCirclePoint[Exp[I 45 Degree], 4, Black, Red],
  ComplexCirclePoint[Exp[I 135 Degree], 4, Black, Red]}]

You could approximately locate the position of points by using DrawingTools.

If you want a movable locator on the circle to locate the random points then
here is a display that does that (for those who have Presentations).

Module[
 {pt = {1, 0}, angle, calcAll},
 calcAll[p_] :=
  (angle = ArcTan @@ p;
   pt = {Cos[angle], Sin[angle]});
 calcAll[pt];
 
 panelpage[
  pagelet[
   Draw2D[
    {ComplexCircle[0, 1],
     ComplexCirclePoint[Exp[I RandomReal[{0, 360}] Degree], 4, Black, 
      Blue],
     ComplexCirclePoint[Exp[I RandomReal[{0, 360}] Degree], 4, Black, 
      Green],
     ComplexCirclePoint[Exp[I RandomReal[{0, 360}] Degree], 4, Black, 
      Brown],
     Locator[Dynamic[pt, (pt = #; calcAll[pt]) &], 
      CirclePointLocator[3, Red]]},
    PlotRange -> 1.2
    ](* Draw2D *),
   Dynamic@
    phrase["point location: ",
     ProportionalNumberForm[Round[#, .001], {4, 3}] & /@ pt,
     " = ",
     ComplexPolar[1, 
      ProportionalNumberForm[Round[angle/Degree, .1], {4, 1}]],
     "\[Degree]"
     ](* phrase *)
   ] (* pagelet *),
  Style["Locating a Point On a Circle", 16],
  paneWidth -> 350](* panelpage *)
 ]


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Marwa Abd El-Wahaab [mailto:m.a.elwahaab at gmail.com] 

Dear Sir,

I am a Mathematica 7 user.

I have a question :

How can I locate points on the circumference of a circle by using
"Graphics"?

I use in drawing the circle:

Graphics[Circle[{0,0},r]]

I need your support

Thanks

Marwa Ali





  • Prev by Date: Re: looping
  • Next by Date: Re: Journals dying?, apparently rather slowly (was ,
  • Previous by thread: Re: A question about location of points on a circle
  • Next by thread: Ha! a document that FAILS because it is in notebook form!