Message Boards Message Boards

4 Replies
0 Total Likes
View groups...
Share this post:

circle and line

Posted 11 years ago
Hello Everyone,
I had asked a question a few days ago, thanks for the answers.
Now I need to improve this code.
I have to draw a circle at only 24 different points like this:
x1[\[Psi]_] := Cos[\[Psi]]
y1[\[Psi]_] := Sin[\[Psi]]
  Table[Point[{x1[\[Psi]], y1[\[Psi]]}], {\[Psi], 0, 2 Pi, 2 Pi/23}]]]
Also at this points I have to show some lines. in other words one of the 24 points is begining point of the line. so x1 and x2 are the first coordinate of this line.
the angle between the line and positive x-axis changes like this:
\[Phi][\[Psi]_] := ArcTan[Sin[\[CapitalPsi]]/(Cos[\[CapitalPsi]] + 0.1)]
so the second coordinate of this line must be like this:
x2[\[Psi]_, \[Phi]_] := Cos[\[Psi]] + Cos[\[Phi]]
y2[\[Psi]_, \[Phi]_] := Sin[\[Psi]] + Sin[\[Phi]]
Now when I try to plot this line it fails:
Graphics[Line[{{x1[\[Psi]], y1[\[Psi]]}, {x2[\[Psi], \[Phi]], y2[\[Psi], \[Phi]]}}]]   
What should I do? Thanks for your helps.
POSTED BY: Teoman Ozturk
4 Replies
Posted 11 years ago
Thank you
POSTED BY: Teoman Ozturk
Posted 11 years ago
Possibly something like this?
 Clear[\[Psi], \[Phi], \[CapitalPsi]];
 x1[\[Psi]_] := Cos[\[Psi]];
 y1[\[Psi]_] := Sin[\[Psi]];
 x2[\[Psi]_, \[Phi]_] := Cos[\[Psi]] + Cos[\[Phi]];
 y2[\[Psi]_, \[Phi]_] := Sin[\[Psi]] + Sin[\[Phi]];
 Show[Graphics[Point[Table[{x1[\[Psi]], y1[\[Psi]]}, {\[Psi], 0, 2 Pi, 2 Pi/23}]]],
  \[Phi] := ArcTan[Sin[\[CapitalPsi]]/(Cos[\[CapitalPsi]] + 0.1)];
  \[Psi] = \[CapitalPsi] = 18 Pi/23;
  Graphics[Line[{{x1[\[Psi]], y1[\[Psi]]}, {x2[\[Psi], \[Phi]], y2[\[Psi], \[Phi]]}}]]]
but this code worries me.
POSTED BY: Bill Simpson
Posted 11 years ago
Actually, the main problem is the drawing the line which depends on the Psi and Phi. the points on the circle depend on the Psi, on the other hand the second coordinates of the lines depend on the Phi. Also  Phi must be changed with Psi like this:
\[Phi][\[Psi]_] := ArcTan[Sin[\[CapitalPsi]]/(Cos[\[CapitalPsi]] + 0.1)]
POSTED BY: Teoman Ozturk
Graphics[Line[{{x1[?], y1[?]}, {x2[?, ?[?], y2[?, ?[?]]}}]] ?
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract