Bug#326720: carg(3) man page error

2005-09-21 Thread Michael Kerrisk
tags 326720 fixed-upstream
thanks

> Ramiro is right - that is, his text is much better than the
> present text. However normalizations differ.
> 
> It is true that tan(carg(z)) = cimag(z) / creal(z),
> almost by definition. Taking atan() on both sides yields
> atan(tan(carg(z))) = atan(cimag(z) / creal(z))
> but it is not precisely true that atan(tan(x)) = x.
> The tan() function is periodic with period pi, and
> atan() returns an answer in (-pi/2,pi/2], so atan(tan(x))
> returns the value that is congruent x mod pi and lies in
> this interval.
> In particular, atan(tan(carg(z))) returns a value that
> is congruent carg(z) mod pi and lies in (-pi/2,pi/2].
> On the other hand, carg returns a value in [-pi,pi]
> and if that return value does not lie in (-pi/2,pi/2]
> then carg(z) and atan(cimag(z) / creal(z)) will differ by pi.
> 
> In other words: you may write
> "One has tan(carg(z)) = cimag(z) / creal(z)."

Okay -- that is what will appear in man-pages-2.08

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#326720: carg(3) man page error

2005-09-20 Thread Ramiro Aceves
> 
> 
> Ramiro is right - that is, his text is much better than the
> present text. However normalizations differ.
> 
> It is true that tan(carg(z)) = cimag(z) / creal(z),
> almost by definition. Taking atan() on both sides yields
> atan(tan(carg(z))) = atan(cimag(z) / creal(z))
> but it is not precisely true that atan(tan(x)) = x.
> The tan() function is periodic with period pi, and
> atan() returns an answer in (-pi/2,pi/2], so atan(tan(x))
> returns the value that is congruent x mod pi and lies in
> this interval.
> In particular, atan(tan(carg(z))) returns a value that
> is congruent carg(z) mod pi and lies in (-pi/2,pi/2].
> On the other hand, carg returns a value in [-pi,pi]
> and if that return value does not lie in (-pi/2,pi/2]
> then carg(z) and atan(cimag(z) / creal(z)) will differ by pi.
> 
> In other words: you may write
> "One has tan(carg(z)) = cimag(z) / creal(z)."
> 
> Andries
> 
> 

Hello Andries, your explanation is superb and very accurate. You are
completely right.

I never thought I could find a bug.;-)
Free software and Debian are marvellous.

Thank you very much.
Ramiro.




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#326720: carg(3) man page error

2005-09-19 Thread Andries Brouwer
On Mon, Sep 19, 2005 at 02:04:00PM +0200, Michael Kerrisk wrote:

> Andries,
> 
> Could you comment on the following please -- I don't remember
> enough of my maths...
> 
> Cheers,
> 
> Michael

Ramiro is right - that is, his text is much better than the
present text. However normalizations differ.

It is true that tan(carg(z)) = cimag(z) / creal(z),
almost by definition. Taking atan() on both sides yields
atan(tan(carg(z))) = atan(cimag(z) / creal(z))
but it is not precisely true that atan(tan(x)) = x.
The tan() function is periodic with period pi, and
atan() returns an answer in (-pi/2,pi/2], so atan(tan(x))
returns the value that is congruent x mod pi and lies in
this interval.
In particular, atan(tan(carg(z))) returns a value that
is congruent carg(z) mod pi and lies in (-pi/2,pi/2].
On the other hand, carg returns a value in [-pi,pi]
and if that return value does not lie in (-pi/2,pi/2]
then carg(z) and atan(cimag(z) / creal(z)) will differ by pi.

In other words: you may write
"One has tan(carg(z)) = cimag(z) / creal(z)."

Andries


>> Von: Ramiro Aceves <[EMAIL PROTECTED]>
>> An: [EMAIL PROTECTED]
>> Betreff: Bug#326720: carg(3) man page error
>> Datum: Mon, 05 Sep 2005 12:19:14 +0200
>> 
>> Package: manpages-dev
>> Version: 1.70-1
>> 
>> There seems to be en error in carg(3) man page, DESCRIPTION chapter.
>> 
>> "One has carg(z) = atan(creal(z) / cimag(z))"
>> 
>>  is wrong and should be :
>> 
>> "One has carg(z) = atan(cimag(z) / creal(z))"
>> 
>> Hope this helps.
>> 
>> Thank you very much.
>> 
>> Ramiro.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#326720: carg(3) man page error

2005-09-19 Thread Michael Kerrisk
tags 326720 fixed-upstream
thanks

Hello Ramiro,

[Original CC list restored...]

> > Andries,
> > 
> > Could you comment on the following please -- I don't remember
> > enough of my maths...
> > 
> > Cheers,
> > 
> > Michael
> 
> 
> Hello Michael,
> 
> I am Ramiro. Yes, a complex number z  has got two componets: a real part
> (creal(z)) and an imaginary part (cimag(z)). I attach a home made ascii
> drawing.
> 
> 
> 
> imaginary axis
> ^
> | >|
> | *|
> | *|
> |  z  *|
> | *|cimag(z)
> | *|
> | *|
> |*  \ angle=carg(z)|
> ||_|_> real axis
>  creal(z)
> 
> 
> Carg(z) is the angle between the complex number z and the real axis,
> measured counterclockwise.
> 
> tan(angle)= cimag(z)/creal(z)
> 
> angle=carg(z)= atan(cimag(z)/creal(z))
> 
> Hope this helps.

Pictures always help :-).

When you put it like that, I'm convinced.  I've changed the page 
as you suggest.  The change will appear in man-pages-2.08.

Cheers,

Michael

> >>--- Ursprüngliche Nachricht ---
> >>Von: Ramiro Aceves <[EMAIL PROTECTED]>
> >>An: [EMAIL PROTECTED]
> >>Betreff: Bug#326720: carg(3) man page error
> >>Datum: Mon, 05 Sep 2005 12:19:14 +0200
> >>
> >>Package: manpages-dev
> >>Version: 1.70-1
> >>
> >>There seems to be en error in carg(3) man page, DESCRIPTION chapter.
> >>
> >>"One has carg(z) = atan(creal(z) / cimag(z))"
> >>
> >> is wrong and should be :
> >>
> >>"One has carg(z) = atan(cimag(z) / creal(z))"
> >>
> >>Hope this helps.
> >>
> >>Thank you very much.
> >>
> >>Ramiro.
> >>
> >>
> > 
> > 
> 

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#326720: carg(3) man page error

2005-09-19 Thread Michael Kerrisk
Andries,

Could you comment on the following please -- I don't remember
enough of my maths...

Cheers,

Michael

> --- Ursprüngliche Nachricht ---
> Von: Ramiro Aceves <[EMAIL PROTECTED]>
> An: [EMAIL PROTECTED]
> Betreff: Bug#326720: carg(3) man page error
> Datum: Mon, 05 Sep 2005 12:19:14 +0200
> 
> Package: manpages-dev
> Version: 1.70-1
> 
> There seems to be en error in carg(3) man page, DESCRIPTION chapter.
> 
> "One has carg(z) = atan(creal(z) / cimag(z))"
> 
>  is wrong and should be :
> 
> "One has carg(z) = atan(cimag(z) / creal(z))"
> 
> Hope this helps.
> 
> Thank you very much.
> 
> Ramiro.
> 
> 

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#326720: carg(3) man page error

2005-09-05 Thread Ramiro Aceves
Package: manpages-dev
Version: 1.70-1

There seems to be en error in carg(3) man page, DESCRIPTION chapter.

"One has carg(z) = atan(creal(z) / cimag(z))"

 is wrong and should be :

"One has carg(z) = atan(cimag(z) / creal(z))"

Hope this helps.

Thank you very much.

Ramiro.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]