Jump to content




[1.0] More linear algebra - the need for matrices and more functions in the vector


  • You cannot reply to this topic
No replies to this topic

#1 trencher

  • New Members
  • 2 posts

Posted 11 May 2012 - 10:55 AM

I was playing around with turtles and vectors found some essential algebra functions missing.

First:

To get the numbers of new calculated vectors, you need more than one command.

vec = vector.new(1,2,3)

x, y, z = vec.x, vec.y, vec.z
-- or
x,y,z = split(vec.tostring, ",", 3)  -- from lua-users.org -wiki
-- instead of something like:
x,y,z = vec.getXYZ()


If I'm right, only this lines need to be added in the vector API:

getXYZ = function( self )
return self.x, self.y, self.z
end

Second:

How about 3x3 matrices for vector transformation, multiplication and solving?







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users