Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: drawing tilted ellipses?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg20493] Re: drawing tilted ellipses?
  • From: adam.smith at hillsdale.edu
  • Date: Wed, 27 Oct 1999 02:04:55 -0400
  • References: <7v3bmr$5te@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

This is easily possible.  First parameterize your ellipse.  Then use a
rotation matrix to transform the {x,y} coordinates into a tilted set.

Below is my code (Maybe not the most elegant, but it works).  I
used "Evaluate" inside the plot to avoid an annoying but harmless
warning message.  Also, be sure to set AspectRatio->Automatic or
Mathematica will scale the height/width in such a way that your ellipse
won't have the proper "look".

In[1]:=
ellipse = {3 *Cos[2*Pi*t],2*Sin[2*Pi*t]};
In[2]:=
ParametricPlot[ Evaluate[ellipse],{t,0,1},AspectRatio->Automatic];
In[3]:=
theta = 30*Pi/180;
rotmatrix = {{Cos[theta],-Sin[theta]},{Sin[theta],Cos[theta]}};
tiltedellipse = rotmatrix.ellipse
Clear[theta];
In[4]:=
ParametricPlot[ Evaluate[tiltedellipse],{t,0,1},AspectRatio->Automatic];

Adam Smith

In article <7v3bmr$5te at smc.vnet.net>,
  Joe Strout <joe at strout.net> wrote:
> Is it possible to draw an ellipse in Mathematica that is not
orthogonal
> to the XY axes?  E.g., leaning over 30 degrees?
>
> I thought perhaps I could specify it orthogonally and then apply a
> rotation transformation, but the only transformations available seem
to
> be scaling (Scaled) and translation (Offset).
>
> Of course I could use a series of line segments, but I want this to be
> smooth even when printed on a high-resolution printer.  Any tips?
>
> Thanks,
> -- Joe
>
> --
> ,------------------------------------------------------------------.
> |    Joseph J. Strout           Biocomputing -- The Salk Institute |
> |    joe at strout.net             http://www.strout.net              |
> `------------------------------------------------------------------'
> Check out the Mac Web Directory!    http://www.strout.net/macweb.cgi
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


  • Prev by Date: Re: Preventing NotebookWrite From Wrapping
  • Next by Date: Re: ScientificForm with NotebookWrite
  • Previous by thread: Re: drawing tilted ellipses?
  • Next by thread: Re: drawing tilted ellipses?