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


Groups > comp.sys.acorn.programmer > #5701

Re: Sine/Cosine/Tangent accuracy error

Subject Re: Sine/Cosine/Tangent accuracy error
Newsgroups comp.sys.acorn.programmer
From druck <news@druck.org.uk>
Date 2019-02-27 20:27 +0000
Message-ID <c42f108d57.druck@druck.org.uk> (permalink)
References <578aeb07c9basura@invalid.addr.uk> <q4v9ot$qe5$1@dont-email.me> <578bf8b556basura@invalid.addr.uk> <mpro.pnjjww01l45o706b4.spamtrap@mw-software.com>
Organization druck

Show all headers | View raw


On 26 Feb 2019 Martin Wuerthner <spamtrap@mw-software.com> wrote:
>> In article <q4v9ot$qe5$1@dont-email.me>, druck <news@druck.org.uk> wrote:
>>> If you are continually incrementing an angle which gets used in
>>> SIN/COS/TAN, take a modulus to prevent it getting to big.
>> 
>>> e.g. If you are incrementing angle variable 'a' degrees
>> 
>>> a = (a + 1) MOD 360
>> 
>>> Or for radians.
>> 
>>> a = (a + 0.01) MOD (2*PI)

> Not such a good idea for radians, since MOD is an integer operator, so it
> will round its argument to a whole number and return a whole number.

Excellent point. I'm getting really rusty on BBC Basic now.

---druck

-- 
The ARM Club Free Software - http://www.armclub.org.uk/free/
32 bit Conversions Page    - http://www.armclub.org.uk/32bit/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Sine/Cosine/Tangent accuracy error Richard Ashbery <basura@invalid.addr.uk> - 2019-02-23 16:28 +0000
  Re: Sine/Cosine/Tangent accuracy error Steve Fryatt <news@stevefryatt.org.uk> - 2019-02-23 17:55 +0000
    Re: Sine/Cosine/Tangent accuracy error Richard Ashbery <basura@invalid.addr.uk> - 2019-02-23 20:53 +0000
      Re: Sine/Cosine/Tangent accuracy error Steve Fryatt <news@stevefryatt.org.uk> - 2019-02-24 08:25 +0000
        Re: Sine/Cosine/Tangent accuracy error Richard Ashbery <basura@invalid.addr.uk> - 2019-02-24 12:20 +0000
  Re: Sine/Cosine/Tangent accuracy error druck <news@druck.org.uk> - 2019-02-24 23:35 +0000
    Re: Sine/Cosine/Tangent accuracy error Richard Ashbery <basura@invalid.addr.uk> - 2019-02-25 17:34 +0000
      Re: Sine/Cosine/Tangent accuracy error Martin Wuerthner <spamtrap@mw-software.com> - 2019-02-26 17:17 +0100
        Re: Sine/Cosine/Tangent accuracy error jgh@mdfs.net - 2019-02-26 12:46 -0800
        Re: Sine/Cosine/Tangent accuracy error Richard Ashbery <basura@invalid.addr.uk> - 2019-02-27 16:37 +0000
        Re: Sine/Cosine/Tangent accuracy error druck <news@druck.org.uk> - 2019-02-27 20:27 +0000

csiph-web