Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. --[[
  2. Class: Vector
  3. API :
  4. ---- functions ----
  5. VectorType(v) -- return if as vector
  6. VectorIntersection(a1,b1,a2,b2) -- return the Intersection of 2 lines
  7. IsLineSegmentIntersection(A,B,C,D) -- return if 2 linesegments intersect
  8. LineSegmentIntersection(A,B,C,D) -- return the Intersection of 2 linesegments
  9. VectorDirection(v1,v2,v)
  10. VectorPointProjectionOnLine(v1, v2, v) -- return a vector on line v1-v2 closest to v
  11. Vector(a,b,c) -- return a vector from x,y,z pos or from another vector
  12. ---- Vector Members ----
  13. x
  14. y
  15. z
  16. ---- Vector Functions ----
  17. vector:clone() -- return a new Vector from vector
  18. vector:unpack() -- x, z
  19. vector:len2() -- return vector^2
  20. vector:len2(v) -- return vector^v
  21. vector:len() -- return vector length
  22. vector:dist(v) -- distance between 2 vectors (v and vector)
  23. vector:normalize() -- normalize vector
  24. vector:normalized() -- return a new Vector normalize from vector
  25. vector:rotate(phiX, phiY, phiZ) -- rotate the vector by phi angle
  26. vector:rotated(phiX, phiY, phiZ) -- return a new Vector rotate from vector by phi angle
  27. vector:projectOn(v) -- return a new Vector from vector projected on v
  28. vector:mirrorOn(v) -- return a new Vector from vector mirrored on v
  29. vector:center(v) -- return center between vector and v
  30. vector:crossP() -- return cross product of vector
  31. vector:dotP() -- return dot product of vector
  32. vector:polar() -- return the angle from axe
  33. vector:angleBetween(v1, v2) -- return the angle formed from vector to v1,v2
  34. vector:compare(v) -- compare vector and v
  35. vector:perpendicular() -- return new Vector rotated 90?right
  36. vector:perpendicular2() -- return new Vector rotated 90?left
  37. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement