-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
jbosh edited this page Nov 19, 2014
·
5 revisions
-
sin, cos, tan
- Trig functions. -
asin, acos, atan
- More trig functions. -
abs
- Using pipes is ambiguous, so you gotta use this func. -
deg/rad
- Convert between radians and degrees. -
ln
- Natural log of something. -
log
- Base 10 log of something. -
sqrt
- Square root. -
cross
- Cross product of 2 vectors. Length must me 2 or 3. 2 has implicit 1 in the z lane. -
dot
- Dot product of 2 vectors. -
normalize
- Change a vectors length to be 1. -
length
- Get the length of a vector. -
round
- Rounds a number to the nearest whole number. -
floor
- Round a number down. -
ceiling
- Rounds a number up. -
endian
- Flip flops the endianness of a number. It finds the smallest number of bytes that can hold a number (2, 4, 8) and byte swaps that. -
lerp
- lerp{{0;1;0};{0;2;0};0.5} = {0; 1.5; 0} Linear interpolation. -
vset_lane
- Sets a lane of a vector. Arguments are {vector; index; value}. Returns the new vector with the set lane. -
vget_lane
- Gets a lane of a vector. Arguments are {vector; index}. Returns that lane.
You can even add your own using scripting.
For example func => value + 6
.