RE: elipse

From: Fine, Valeri <>
Date: Sat, 2 Sep 2006 14:41:32 -0400

Hello Nasim,  

> I know the cordinates of four different arbitary points of the elipse

  This does allow you to calculate any ellipse parameter yourself  

> and o the angle of the semi-major axis with respect to the x axis.
> is that any way to draw such an elipse in root.

I am afraid ROOT has no direct method to provide the arbitrary 2D coordinate transformation the kind of thing one needs to rotate the 2D figures.  

There are two solutions:  

  1. Do things yourself, namely
      1.1.  Calculate the several ellipse points 
               (enough to make the polylyne  looks smooth, see p 1.3. below)
              using the ellipse formula
      1.2.  Apply the rotation matrix to get it the way you want
      1.3.  Create TPolyLine object 
      1.4.  Draw that object
  2. Take advantage of ROOT/ Qt layer. This way you can use Qt classes and API within your ROOT application. 
      This means you can use the class QPainter and its methods:

See: for details and for the list of Qt classes available from the ROOT Cint command prompt. (Bear in mind that all Qt classes are available from the compiled code). Let me know whether you need a working Qt/Root example. I could make it available by Monday  

 Hope this helps.  


Many Thanks,

Received on Sat Sep 02 2006 - 20:42:14 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET