Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Class: Vector
- API :
- ---- functions ----
- VectorType(v) -- return if as vector
- VectorIntersection(a1,b1,a2,b2) -- return the Intersection of 2 lines
- IsLineSegmentIntersection(A,B,C,D) -- return if 2 linesegments intersect
- LineSegmentIntersection(A,B,C,D) -- return the Intersection of 2 linesegments
- VectorDirection(v1,v2,v)
- VectorPointProjectionOnLine(v1, v2, v) -- return a vector on line v1-v2 closest to v
- Vector(a,b,c) -- return a vector from x,y,z pos or from another vector
- ---- Vector Members ----
- x
- y
- z
- ---- Vector Functions ----
- vector:clone() -- return a new Vector from vector
- vector:unpack() -- x, z
- vector:len2() -- return vector^2
- vector:len2(v) -- return vector^v
- vector:len() -- return vector length
- vector:dist(v) -- distance between 2 vectors (v and vector)
- vector:normalize() -- normalize vector
- vector:normalized() -- return a new Vector normalize from vector
- vector:rotate(phiX, phiY, phiZ) -- rotate the vector by phi angle
- vector:rotated(phiX, phiY, phiZ) -- return a new Vector rotate from vector by phi angle
- vector:projectOn(v) -- return a new Vector from vector projected on v
- vector:mirrorOn(v) -- return a new Vector from vector mirrored on v
- vector:center(v) -- return center between vector and v
- vector:crossP() -- return cross product of vector
- vector:dotP() -- return dot product of vector
- vector:polar() -- return the angle from axe
- vector:angleBetween(v1, v2) -- return the angle formed from vector to v1,v2
- vector:compare(v) -- compare vector and v
- vector:perpendicular() -- return new Vector rotated 90?right
- vector:perpendicular2() -- return new Vector rotated 90?left
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement