Amos Professional Manual  Contents  Index

Maths


The HSIN function calculates the hyperbolic sine of a given angle.

HCOS
function: calculate hyperbolic cosine
h#=Hcos(angle)
h#=Hcos(angle#)

Use this function to find the hyperbolic cosine of an angle.

HTAN
function: calculate hyperbolic tangent
h#=Htan(angle)
h#=Htan(angle#)

HTAN returns the hyperbolic tangent of the given angle.

Random numbers
The easiest way to introduce an element of chance or surprise into a program is to throw some numbered options into an electronic pot and allow AMOS Professional to pull one out at random. After a number has been selected and used, it is thrown back into the pot once again. It then has the same chance as any other number offered for selection, when the next random choice is made.

RND
function: generate a random number
value=Rnd(number)

The RND function generates integers at random, between zero and any number specified in brackets. If your specified number is greater than zero, random numbers will be generated up to that maximum number. However, if you specify 0, then RND will return the last random value it generated. This is useful for debugging programs. Here is an example:

E> Do
    C=Rnd(15) : X=Rnd(320) : Y=Rnd(200)
    Ink C : Text X,Y,"AMOS Professional at RANDOM"
   Loop

RANDOMIZE
instruction: set the seed for a random number
Randomize seed

In practice, the numbers produced by the RND function are not genuinely random at all. They are computed by an internal mathematical formula, whose starting point is taken from a number known as a "seed". This seed is set to a standard value whenever AMOS Professional is loaded into your Amiga, and that means that the sequence of numbers generated by the RND function will be exactly the same each time your program is run.

Back    Next
05.03.10