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


Groups > comp.lang.forth > #35158

Re: Program or be Programmed !

From Paul E Bennett <Paul_E.Bennett@topmail.co.uk>
Newsgroups comp.lang.forth
Subject Re: Program or be Programmed !
Date 2014-12-23 22:30 +0000
Organization Hidecs Consultancy
Message-ID <cfu8olFga0mU1@mid.individual.net> (permalink)
References <cfrte2Frt26U1@mid.individual.net> <OcydnVONz8oAFwTJnZ2dnUU7-a2dnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley wrote:

> Paul E Bennett <Paul_E.Bennett@topmail.co.uk> wrote:
>> 
>> : (DDA) ( S: sin\cos -- sin'\cos' )
>> ( This code is the main sine wave generator )
>>  tuck over
>>  256 / + -rot
>>  swap 256 / - swap
>> ;
>> 
> 
> Very pretty.  d/dx sin = cos, d/dx cos = -sin.  The error builds up
> very fast, but you reset the DDA every cycle so that doesn't matter.
> This is very appealing to me, and it would have been to me as a child
> too.
> 
> Andrew.

Thanks Andrew. It took me a little while reading some of the papers on the 
subject but having tried it out and decided to reset every cycle it gives a 
very nice and consistent waveform.

Comments on the rest of the code and the coding style (which is my rough-out 
standard) are welcome.

-- 
********************************************************************
Paul E. Bennett IEng MIET.....<email://Paul_E.Bennett@topmail.co.uk>
Forth based HIDECS Consultancy.............<http://www.hidecs.co.uk>
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-510979
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-23 01:05 +0000
  Re: Program or be Programmed ! Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-23 09:30 -0600
    Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-23 22:30 +0000
      Re: Program or be Programmed ! Paul Rubin <no.email@nospam.invalid> - 2014-12-24 00:13 -0800
        Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-24 14:33 +0000

csiph-web