AminetAminet
Search:
84714 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/src/SINE.rexx.txt

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Text mode sinewave _anim_ in pure ARexx.
Author:wisecracker at tesco.net (Barry Walker)
Uploader:wisecracker tesco net (Barry Walker)
Type:dev/src
Version:1.00.00
Architecture:generic
Date:2017-11-15
Download:http://aminet.net/dev/src/SINE.rexx.txt - View contents
Readme:http://aminet.net/dev/src/SINE.rexx.readme
Downloads:1199

Distribution: Public Domain, Emailware.

============================================================================

Architectures: Classic AMIGA A1200, WinUAE, FS-UAE.
---------------------------------------------------

  MINIMUM Requirements Are:-
  --------------------------

       Stock A1200. (4MB Fast RAM is a bonus.)
       WinUAE 1.5.3, minimum.
       FS-UAE. (Minimum version as of June 2017.)
       Standard default OS 3.0.x install or better.

----------------------------------------------------------------------------

  History:-
  ---------

  11-14-2017.
  -----------
  Version 1.00.00. Probably the one and only upload for this archive.

----------------------------------------------------------------------------

  General:-
  ---------

  This is a proof of concept to see if it is possible to plot a sinewave
  curve in nothing but the default ARexx install. As SIN(x) does not exist
  then this is also part of this DEMO. Remember this is proof of concept and
  will be used with reference to my FFT_AMIGA.py function to create a
  spectrum display without the need for ADE the UNIX environment for the
  A1200.
  There are no dependencies needed for this DEMO.
  Below is the DEMO of the said SIN subroutine...

[CODE]
/* SIN _function_ DEMO, licence CC0, by B.Walker, 2017. */
/* y=sin(x), where x is a floating point value from 0 to 360 degrees. */
/* Called as: */
/*	ANGLE=<some_angle_from_0_to_360_Degrees> */
/*	CALL SIN */
/* 'y' is the variable where it is stored. */
/* Example:- */

DO THETA=0.0 TO 360.0 BY 15.0
ANGLE=THETA
CALL SIN
SAY THETA y
END
STOP

/* SIN subroutine, '_Function_'. */
SIN:
/* Greater than 360.0 degrees NOT catered for but easily cured. */
IF ANGLE>=360.0 THEN ANGLE=0.0
IF ANGLE>270.0 THEN ANGLE=ANGLE-360.0
IF ANGLE>180.0 THEN ANGLE=-(ANGLE-180.0)
IF ANGLE>90.0 THEN ANGLE=180.0-ANGLE
/* Convert to radians. */
PI=3.14159265
x=((ANGLE*PI)/180)
y=x-((x**3)/6)+((x**5)/120)-((x**7)/5040)+((x**9)/362880)-((x**11)/39916800)
IF ANGLE=0.0 THEN y=0.0
IF ANGLE=90.0 THEN y=1.0
IF ANGLE=-90.0 THEN y=-1.0
RETURN
[/CODE]

  This subroutine returns its floating point value inside the variable 'y'.

  Just download the file SINE.rexx.txt to anywhere of your choice and rename
  it to SINE.rexx. Open a shell with a minimum size of 23 lines by 77
  columns and start RexxMast. Next, execute this file by using
  RX SINE.rexx<ENTER>.
  If all goes well then white asterisks are plotted in the form of a text
  mode sinewave. The amplitude is 20 lines in height and the single cycle is
  60 columns wide.

  Enjoy finding simple solutions to often very difficult problems.

----------------------------------------------------------------------------

  This archive is issued under the CC0 Licence.
  (Originally written by B.Walker, G0LCU, 2017.)

----------------------------------------------------------------------------

                                IMPORTANT:-
                                -----------

    The Legal Stuff:-
    -----------------

    This code is CC0 licenced.

    The author is not responsible for any damage to, or loss of, or failure
    of equipment or data caused in any way by the use of these programs.

    There is NO warranty with the use of these software releases and
    YOU USE THEM AT YOUR OWN RISK.

----------------------------------------------------------------------------

    Testing Evaluation:-
    --------------------

    All WinUAE, FS-UAE and Classic AMIGA test conditions were/are running
    standard OS3.0.x and using standard ~topaz 8~ fonts throughout.

    I have no idea what strange configuration setups will create so refer
    to the ~The Legal Stuff~ above.

----------------------------------------------------------------------------

   A very useful HardWare related site, (C) Anthony Hoffman, for
   modifications, schematics, repairs and the like is:-

                          http://amiga.serveftp.net/

============================================================================


Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>