comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Many overlook the possibility sin(x,360.0) ?
Date: Mon, 1 May 2017 22:04:10 +0200
Date: 2017-05-01T22:04:10+02:00	[thread overview]
Message-ID: <oe84bp$4hv$1@gioia.aioe.org> (raw)
In-Reply-To: oe7s8n$1l82$1@gioia.aioe.org

On 2017-05-01 19:46, Nasser M. Abbasi wrote:
> On 5/1/2017 12:22 AM, reinert wrote:

>> Not a big philosophical question, but:
>>
>> I have often seen in (others) Ada code that many prefer to use for
>> example sin(x)
>> where they first calculate x := rad_per_degree*degrees.
>>
>> Why they do not use sin(degrees,360.0) if they need to use degree.
>> Are there a good reason? Using sin(x, 3600.0) seems to keep the code
>> simpler. Sometimes I even use sin(x,period).

I remember the first thing they taught us during the first semester was 
to ditch degrees...

> btw,  These are implemented in other languages as follows:
>
> In Mathematica one can type
>
> Sin[ 360 Degree]
>
> in Matlab one uses sind(360) instead of sin() for degrees.

Which is *exactly* same as in Ada.

The notation 300 Degree is <value><unit> = <value>*<unit>. 
rad_per_degree = Degree = Pi/180.0 is <unit> here (dimensionless).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2017-05-01 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01  5:22 Many overlook the possibility sin(x,360.0) ? reinert
2017-05-01  8:50 ` hreba
2017-05-01 17:46 ` Nasser M. Abbasi
2017-05-01 20:04   ` Dmitry A. Kazakov [this message]
2017-05-01 20:46     ` Shark8
2017-05-02  6:37       ` reinert
2017-05-02  8:35         ` Dmitry A. Kazakov
2017-05-03  4:12           ` reinert
2017-05-03  7:18             ` Dmitry A. Kazakov
2017-05-08 17:37               ` reinert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox