Re: [PATCH v2 guile-lib] src: (math trigonometry): Add it.

2025-02-21 Thread Adam Faiz
> atan(0,0) is not well-defined (more precisely, there is no unique choice > within the interval [0,360°)) - if the point (0,0) is written in polar > coordinates (0*cos theta, 0*sin theta), then any angle theta can be used. > > > If you intend to support (arctan2 0 0), it may be good to mention

Re: [PATCH v2 guile-lib] src: (math trigonometry): Add it.

2025-02-17 Thread Maxime Devos
On 17/02/2025 8:03, Adam Faiz wrote: + (cond ((zero? x) + (let ((sign (if (positive? y) + -))) + (sign 90))) atan(0,0) is not well-defined (more precisely, there is no unique choice within the interval [0,360°)) - if the point (0,0) is written in polar coordinates (0*cos t

[PATCH v2 guile-lib] src: (math trigonometry): Add it.

2025-02-16 Thread Adam Faiz
This revised patch documents the limitations of this module and adds more unit tests. I've also changed the functions to short-circuit only results that are rational, since the exactness property is already lost in any case when the square roots are irrational. >From 5eb3be7ce0781068d8e0030c4e5