Difference between revisions of "SCI Kernel Documentation/Arithmetic Functions"
(Created page with "Official SCI Documentation<br /> <div align="center"> Chapter: 1 | 2 | SCI...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
[[SCI Kernel Documentation/String Functions|6]] | | [[SCI Kernel Documentation/String Functions|6]] | | ||
[[SCI Kernel Documentation/Picture Functions|7]] | | [[SCI Kernel Documentation/Picture Functions|7]] | | ||
− | [[SCI Kernel Documentation/Save | + | [[SCI Kernel Documentation/Save-Restore Game Functions|8]] | |
[[SCI Kernel Documentation/Animation Functions|9]] | | [[SCI Kernel Documentation/Animation Functions|9]] | | ||
[[SCI Kernel Documentation/Graphic Screen Functions|10]] | | [[SCI Kernel Documentation/Graphic Screen Functions|10]] | | ||
Line 23: | Line 23: | ||
</div><br /> | </div><br /> | ||
− | <div align="center"><span style="font-size: 22pt"></span><br /> | + | <div align="center"><span style="font-size: 22pt">Arithmetic Functions</span><br /> |
''Author: [[Jeff Stephenson]]''<br /> | ''Author: [[Jeff Stephenson]]''<br /> | ||
''Revision by: David Slayback''</div> | ''Revision by: David Slayback''</div> | ||
Line 29: | Line 29: | ||
| | ||
− | + | ==<br /> Arithmetic Functions == | |
+ | |||
+ | ===<br /> (Random min max) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns a random number n such that 0 < min <= n <= max. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (Abs number) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns the absolute value of the signed integer number. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (Sqrt number) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns the square root of number, which is assumed to be unsigned. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GetDistance x1 y1 x2 y2 [perspective]) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GetAngle x1 y1 x2 y2) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SinMult angle num) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns num multiplied by the sine of angle. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CosMult angle num) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns num multiplied by the cosine of angle. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SinDiv angle num) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns num divided by the sine of angle. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CosDiv angle num) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns num divided by the cosine of angle | ||
+ | </blockquote> | ||
| | ||
Line 42: | Line 96: | ||
| | ||
− | <span style="float: left">[[SCI Kernel Documentation/|< Previous: ]]</span><span style="float: right">[[SCI Kernel Documentation/|Next: | + | <span style="float: left">[[SCI Kernel Documentation/Sound Functions|< Previous: Sound Functions]]</span> |
+ | <span style="float: right">[[SCI Kernel Documentation/File Functions|Next: File Functions >]]</span> | ||
| | ||
[[Category:SCI Documentation]] | [[Category:SCI Documentation]] | ||
− | |||
[[Category:Kernel Functions]] | [[Category:Kernel Functions]] | ||
+ | [[Category:Arithmetic Functions]] |
Latest revision as of 14:23, 3 December 2015
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
< Previous: Sound Functions Next: File Functions >