-
Notifications
You must be signed in to change notification settings - Fork 17
Degree trigonometric functions #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To: J3 J3/18-272r1 I Introduction II Use cases This provides a portable mechanism for programs that have III What I have in mind First, the prevailing principle is that only generic functions [...] Finally, add the generic intrinsics listed above. |
To: J3 J3/19-203r1 1 Introduction Addition of the degree trigonometric functions was given specifications 2 Specifications These elemental intrinsics are generic and not specific. 3 Syntax
4 Edits to 18-007r1 |
A logical next step would be to add conversion functions between degrees and radians to the standard. Usual function names are: rad2deg, deg, degrees; deg2rad, rad, radians. Use case: Often it is necessary to use angles in radians in calculation, e.g. to calculate arc length of a unit circle. Example: the involute function inv(x) = tan(x) - x. Correctly rounded multiplication by arbitrary precision constants (π/180) or (180/π) is non-trivial.
4 Edits TODORADIANS(): define additional (optional) parameters
|
Alternatively these conversion functions can go into stdlib.
…On Wed, Mar 4, 2020, at 6:41 AM, Thomas Henlich wrote:
A logical next step would be to add conversion functions between
degrees and radians to the standard. Usual function names are: deg2rad,
deg, degrees; rad2deg, rad, radians.
Use case: Often it is necessary to use angles in radians in
calculation, e.g. to calculate arc length of a unit circle. Example:
the involute function inv(x) = tan(x) - x.
Correctly rounded multiplication by arbitrary precision constants
<http://perso.ens-lyon.fr/jean-michel.muller/MultConstant.html> (π/180)
or (180/π) is non-trivial.
`DEGREES (X)
Description: Radians to degrees conversion function.
Class: Elemental function.
Argument: X shall be of type real, regarded as a value in radians.
Result Characteristics: Same as X.
Result Value: The result has a value equal to a processor-dependent
approximation to X, where X is expressed in degrees.
RADIANS (X)
Description: Degrees to radians conversion function.
Class: Elemental function.
Argument: X shall be of type real, regarded as a value in degrees.
Result Characteristics: Same as X.
Result Value: The result has a value equal to a processor-dependent
approximation to X, where X is expressed in radians.
`
4 Edits
[...]
Example. DEGREES (3.141593) has the value 180.0 (approximately).
[...]
Example. RADIANS (-360.0) has the value -6.283185 (approximately).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#164?email_source=notifications&email_token=AAAFAWAUW2GOL5JSWPL4DNDRFZK6ZA5CNFSM4K72DTD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENX4ULI#issuecomment-594528813>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAFAWEAWF2PSLZRLI5RV6LRFZK6ZANCNFSM4K72DTDQ>.
|
As another alternative: intrinsic functions that provide multiplication and division by a constant of a distinct (more precise) kind of |
The Fortran standard is not concerned where or how these functions would be implemented (the word "processor-dependent" is used a lot there), just with what they should do, and how they would be used in a standard-conforming program. |
To: J3 J3/18-139r1
From: Steve Lionel @sblionel
Subject: Degree trigonometric functions
Date: 2018-February-16
Many if not most Fortran implementations support, as extensions,
degree-argument (or return value) versions of some of the trigonometric
intrinsic functions, and these are widely used. In the spirit of
standardizing existing practice, we should add the following generic
intrinsic functions to the standard:
All of these would be similar to their radian counterparts
except that the argument(s) or return values would be in degrees.
During J3 discussion it was noted:
therefore need no degree equivalents.
ATAN, it was felt appropriate to include ATAN2D in support of
existing practice.
The text was updated successfully, but these errors were encountered: