Message Boards Message Boards

0
|
5710 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How do I fix my formatting if I'm not getting a syntax error?

Posted 11 years ago
I'm very new to Mathematica; I'm trying to use it to display a quadrilateral with some extensions (perpendicular bisectors to two of the sides).

My syntax appears fine, but the error messages say that "An improperly formatted option head (Rational) was encountered while reading a Line. The head of the option must be Rule or RuleDelayed," or several similar things--some that just say  "Plus" rather than "Rational," and one that says that "An improperly formatted option was encountered while reading a Line. The option was not in the form of a rule."

These are simple operators, like + and /, so I don't know how I managed to misuse them. I also don't know an "option head" is, or what it means to be Rule or RuleDelayed...
 pointP[angle_] :=
 {1/2, ((1 + Cos[angle])*(Cos[angle])/(2 - 2*Sin[angle]) + (1 + Sin[angle])/2)}
 
 midpointCD[angle_] := {1/2 + Cos[angle]/2, 1/2 + Sin[angle]/2}
 
 picture[angle_] :=
 Line[{{0, 1}, {1 + Cos[angle], Sin[angle]}, {1, 0}, {0, 0}, {0, 1}}, {midpointCD[angle], pointP[angle],  {1/2, 0}}]
 
 drawPicture[angle_] := Graphics[picture[angle]]
drawPicture[Pi/4]

Help would be much appreciated. Thank you!
POSTED BY: Jenny K
Posted 11 years ago
picture[angle_] :=
Line[{{{0,1}, {1+Cos[angle], Sin[angle]}, {1,0}, {0,0}, {0,1}}, {midpointCD[angle], pointP[angle], {1/2,0}}}];
You need one more layer of {} for a collection of lines
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract