SCI Kernel Documentation/Arithmetic Functions

From SCI Wiki
Revision as of 14:23, 3 December 2015 by Andrew Branscom (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Arithmetic Functions

Author: Jeff Stephenson

Revision by: David Slayback

 


Arithmetic Functions


(Random min max)

Returns a random number n such that 0 < min <= n <= max.


(Abs number)

Returns the absolute value of the signed integer number.


(Sqrt number)

Returns the square root of number, which is assumed to be unsigned.


(GetDistance x1 y1 x2 y2 [perspective])

Returns the distance between the two points determined by (x1, y1) and (x2, y2). perspective is the users point of view of the room in degrees away from the vertical along the y axis, which makes each y-pixel represent a greater distance than an x-pixel.


(GetAngle x1 y1 x2 y2)

Returns the angle between the two points determined by (x1, y1) and (x2, y2). The angle is measured in degrees and is between 0 and 359 degrees.


(SinMult angle num)

Returns num multiplied by the sine of angle.


(CosMult angle num)

Returns num multiplied by the cosine of angle.


(SinDiv angle num)

Returns num divided by the sine of angle.


(CosDiv angle num)

Returns num divided by the cosine of angle

 

Notes


 

Table of Contents

 

< Previous: Sound Functions Next: File Functions >