Home Contents Forum Links Tip Jar
Animation Math in Lingo       

Lingo Math Functions

abs(n)
returns the absolute value of n
 
atan(n)
returns the arc-tangent of n. See Sine & Cosine Definitions
 
atan(y, x)
returns the angle, in radians, between the positive x axis and the
vector [x,y]. Similar to atan(n), with a few differences as explained in Sine & Cosine Definitions
 
bitAnd(n), bitNot(n), bitOr(n), bitXor(n)
these are binary functions. Their use in animation is limited since they aren't continuous functions. See Director Help for more information.
 
cos(t)
returns the cosine of t. See Sine & Cosine Definitions
 
exp(n)
returns e^n. e is a significant number in calculus, with a value of about 2.72
 
float(n)
returns a floating point number equal to n
 
floatP(n)
returns 1 (true) if n is a float, 0 (false) otherwise
 
integer(n)
returns the integer that n rounds to
 
integerP(n)
returns 1 (true) if n is an integer variable, 0 (false) otherwise
 
log(n)
returns the natural log of n. Natural log is log base e. To use any base, use this expression: log(n)/log(base)
 
max(a,b)
returns the larger of a and b
 
min(a,b)
returns the smaller of a and b

mod
A mod B returns the remainder after long-dividing B into A
random(n)
returns a random integer between 1 and n, inclusive
 
pi()
returns the value of pi, about 3.1415926535897...
 
power(a,b)
returns a raised to b, ab
 
sin(t)
returns the sine of t. See Sine & Cosine Definitions
 
sqrt(n)
returns the square root of n. Equivalent to power(n,.5)
 
tan(t)
returns the tangent of t. Equivalent to sin(t)/cos(t). See Sine & Cosine Definitions
 
 


Copyright © 2003 JM Harward 
 jmckell~at~jmckell~dot~com
All lingo provided on this site may be used freely for educational purposes. Not for redistribution as uncompiled code. Instructional materials may not be reproduced without permission.