← Back to context

Comment by the__alchemist

4 days ago

Holy shit I have to try this.

Unfortunately, IEEE Std 754 contains a huge mistake, which has been followed by some standard libraries for programming languages.

As an alternative to the trigonometric functions with arguments measured in radians, it recommends a set of functions with arguments measured in half-cycles: sinPi, cosPi, atanPi, atan2Pi and so on.

I do not who is guilty for this, because I have never ever encountered a case when you want to measure angles in half-cycles. There are cases when it would be more convenient to measure angles in right angles (i.e. quarters of a cycle), but half-cycles are always worse than both cycles and right angles. An example where measuring angles in cycles is optimal is when you deal with Fourier series or Fourier transforms. When the unit is the cycle that deletes a proportionality constant from the Fourier formulae, and that constant is always present when any other unit is used, e.g. the radian, the degree or the half-cycle.

Due to this mistake in the standard, it is more likely to find a standard library that includes these functions with angles measured in half-cycles than a library with the corresponding functions for cycles. Half-cycles are still better than radians, by producing more accurate results and being faster, but it may be hard to avoid some scalings by two. However, usually it is not necessary to do a scaling at every invocation, but there are chances that the scalings can be moved outside of loops.

Such functions written for angles measured in half-cycles can be easily modified to work with arguments measured in cycles, but if one does not want to touch a standard library, they may be used as they are.

When one uses consistently the cycle as the unit of angle, which is consistent with measuring frequencies in Hertz, i.e. cycle per second, instead of measuring them in radian per second, one must pay attention to the fact that a lot of formulae from most handbooks of physics are incorrect. Despite the claim that those formulae are written in a form that is independent of the system of units, this claim is false because many formulae are written in a form that is valid only when the unit of angle is the radian.

For example, all formulae for quantities related to rotation movements, as they are written in modern handbooks contain the "radius". This use of the "radius" creates a wrong mental model of the rotational quantities, both for students and also even for many experienced physicists.

In reality, in all those formulae, e.g. in the definition of the angular momentum, in order to obtain the correct formulae one must replace the "radius" with the inverse of the curvature of the trajectory of the movement. Thus the angular momentum is not the product of the linear momentum by the radius, but it is the ratio between the linear momentum and the curvature.

Then one must use the correct definition for the curvature. Most handbooks define the curvature as the inverse of the radius. This is a wrong definition, which is based on the non-explicit assumption that angles are measured in radians.

The correct definition of the curvature is as the ratio between rotation angle and length, for the movement, i.e. more precisely it is the derivative of the rotation angle as a function of the length of the curve on which something moves. When angles are measured in radians, the curvature is the inverse of the radius. When angles are measured in cycles, the curvature is the inverse of the perimeter. Thus with angles measured in cycles the angular momentum is defined as the product between the linear momentum and perimeter. Similarly for the other rotational quantities, like angular velocity and acceleration, moment of inertia and so on.

  • Great's great info on curvature! Also don't see the use of the half cycle, although obviously see use of cycle. (As was thinking in terms of them anyway, just with a tau term to convert to radians.)