Re: TPad::PixeltoY : wrong result

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 10 Apr 2006 09:47:04 +0200 (CEST)

Hi Hajo,

 I am afraid you are right. I will have a closer look at this question to see if we can fix that. But, as these two functions are used every where, I guess that changing the behavior of one of them will produce many backward compatibility problems and some existing software may suddenly not work. I think that the best we will be able to offer will be to document clearly this weird behavior. I will have a closer look and let you know.

 Cheers, Olivier

On Sun, 9 Apr 2006, Hajo Molegraaf wrote:

> Hi,
> I have the impression that TPad::PixeltoY returns a wrong answer. Consider the
> following:
>
> root [0] TCanvas* c = new TCanvas
> root [1] TH2F* axes = new TH2F("","",10,-5,20,10,-1,2.5)
> root [2] axes->Draw()
> root [3] c->Draw()
> root [4] c->XtoPixel(5.0)
> (const Int_t)292
> root [5] c->PixeltoX(292)
> (Double_t)4.98563216049116953e+00 // Correct
> root [6] c->YtoPixel(1.0)
> (const Int_t)209
> root [7] c->PixeltoY(209)
> (Double_t)(-3.37473520790611614e+00) // Wrong
> root [8] c->PixeltoY(209 - c->GetWh())
> (Double_t)1.00026483283924716e+00 // Correct !!
>
> I have the impression that YtoPixel uses a positive y-axis that runs from the
> top to the bottom, while YtoPixel uses a positive y-axis that runs from the
> bottom to the top. Or am I doing something wrong?
>
> Hajo.
>
> _________________________________________________________________
> Krijg direct antwoord op je vragen: MSN Messenger
> http://www1.imagine-msn.com/Messenger/Default2.aspx
>
>

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet_at_cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7670300
Received on Mon Apr 10 2006 - 09:47:09 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET