Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1573

Re: -100 0 atan ==> 270 or -90?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Helge Blischke <h.blischke@acm.org>
Newsgroups comp.lang.postscript
Subject Re: -100 0 atan ==> 270 or -90?
Followup-To comp.lang.postscript
Date Sat, 03 Aug 2013 15:42:18 +0200
Lines 34
Message-ID <b64flrFagvcU1@mid.individual.net> (permalink)
References <fa9d6107-0deb-48c7-9744-6236e4f97bb0@googlegroups.com> <874nb7dwt5.fsf@Aspire.decebal.nl>
Mime-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding 7Bit
X-Trace individual.net /IBQmvvJsa5odYLJF52tzwui5VcxFitZyaSs19MdBXAzZRPqon
Cancel-Lock sha1:35r920LA20S8ILDVsfIV5/KRb24=
User-Agent KNode/0.99.01
Xref csiph.com comp.lang.postscript:1573

Followups directed to: comp.lang.postscript

Show key headers only | View raw


Cecil Westerhof wrote:

> Op zaterdag 3 aug 2013 06:23 CEST schreef luser:
> 
>> I've started writing up a test program for all operators,
>> mostly using the example snippets from the manual.
>>
>> And I've run into a difference between the Red Book (PLRM 1ed)
>> and the GNU C library in the value returned by atan.
>>
>> The Red Book says:
>>
>> -100 0 atan => 270.0
>>
>> But atan2(3) (after suitable conversions) gives me -90.0
>>
>> Is this serious? And, if so, what (if anything) should I do about
>> it?
> 
> It looks like postscript does a modulo 360. Which in certain
> definitions gives a value between 0 and modVal. The funny thing being
> that mod gives a value between -modVal and modVal.
> 
> So I would say it is a bug.
> 
The PLRM (3rd ed.) says:
atan num den atan angle
returns the angle (in degrees between 0 and 360) whose tangent is num 
divided by den.

So the positive value seems to be intentional.

Helge

Back to comp.lang.postscript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

-100 0 atan ==> 270 or -90? luser- -droog <mijoryx@yahoo.com> - 2013-08-02 21:23 -0700
  Re: -100 0 atan ==> 270 or -90? luser- -droog <mijoryx@yahoo.com> - 2013-08-02 23:59 -0700
    Re: -100 0 atan ==> 270 or -90? James Cloos <cloos@jhcloos.com> - 2013-08-06 20:59 -0400
  Re: -100 0 atan ==> 270 or -90? Cecil Westerhof <Cecil@decebal.nl> - 2013-08-03 10:04 +0200
    Re: -100 0 atan ==> 270 or -90? Helge Blischke <h.blischke@acm.org> - 2013-08-03 15:42 +0200

csiph-web