pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 26 Nov 2011 12:31 PM |
I'm going to be making a library of math functions that can be used in addition to the ones that are already included in Lua's standard math library, however I'd like to get a list of functions to implement. Please put your suggestions, and a brief description of what that function would do. I'll release the library when I'm done with it.
---------- ~ pwendu46, the unicorn ~ |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2011 12:35 PM |
You should make functions that can solve functions like this: y^2+4xy+5=x |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2011 12:39 PM |
The function that DonnyTheDemented put is definitly hard for me.He's good at functions like this ~purplediva8~ |
|
|
| Report Abuse |
|
|
TaslemGuy
|
  |
| Joined: 10 Jun 2009 |
| Total Posts: 12174 |
|
|
| 26 Nov 2011 01:06 PM |
@Donny:
(A) "y^2+4xy+5=x" is not a function.
(B) Define "like." Other hyperbolas? |
|
|
| Report Abuse |
|
|
TaslemGuy
|
  |
| Joined: 10 Jun 2009 |
| Total Posts: 12174 |
|
|
| 26 Nov 2011 01:08 PM |
Oh, wait. Yes, it is a function, x(y) = (y*y + 5) / (1 - 4y), y ~= 1/4
Regardless, you need to be more specific. |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2011 01:10 PM |
-Slerp This lerps unit vectors, but instead of just making a line from a to b, it "rotates" the unit vector. Heres the code for it (you can improve):
function Slerp(a,b,t) --slerps from a to b, given alpha (t) between 0 and 1 if t==1 then return b end local dot = a:Dot(b) local angle=math.acos(dot)*t if angle==0 then return a end local c=(b - a*dot).unit return a*math.cos(angle) + c*math.sin(angle) end
-More vector3 functions (make these for numbers too i guess) *Clamp(myvec,Vector3.new(0,0,0),Vector3.new(10,10,10)) clamps each component of myvec between components of first and second vector. *VectorAbs(vec) returns vector with all components positive *VectorPolarity(vec) returns vector with each component being -1,0 or 1, depending on whether the corresponding component of vec is negative, 0 or positive.
-Bezier curve functions so you can smooth choor paths. (give few vector3's and a ton of variables, get a list of more vector3s that form a smoothis curve) This one might be difficult
-A ton of super efficient sorting functions you found from the dark corner of google. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 26 Nov 2011 03:20 PM |
"-Bezier curve functions so you can smooth choor paths. (give few vector3's and a ton of variables, get a list of more vector3s that form a smoothis curve) This one might be difficult"
Uhh...what is a bezier curve? I may not implement this one.
---------- ~ pwendu46, the unicorn ~ |
|
|
| Report Abuse |
|
|