Advertisement
TempusMoon

Untitled

May 5th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.77 KB | None | 0 0
  1. --REAL SYSTEM GRAPHER. FOR IMAGINARY SYSTEM GRAPHER, SEE REV II.
  2. --ZippyArnold123456789, Calculus III, Abstract Algebra
  3. div = true--divergence, actually worthless of a variable since its under dev
  4. distinct = true --make the graphs less confusing to analyze
  5. seethrough = .1 --transparency, .1 allows visibility between g(x,y), and h(x,y), 0 does not, and so on
  6. local studier ="Guardian_Artwena"--you
  7. d1=-4*math.pi--domain 1
  8. d2=4*math.pi--domain 2
  9. --time to start definitions to make this feel more real than computeristic
  10. --omg!!! makes my life so much easier!!! -Arnold G.
  11. ln = math.log
  12. rad = function(aX) return math.rad(aX) end
  13. sqrt = math.sqrt
  14. Nroot = function(aX,NUM) return aX^(1/NUM) end --nth root, Nroot(number,nrootnum)
  15. sin = math.sin
  16. cos = math.cos
  17. floor = math.floor
  18. ceil = math.ceil
  19. tan = math.tan
  20. tanh = math.tanh
  21. sinh = math.sinh
  22. cosh = math.cosh
  23. pow = math.pow
  24. atan = math.atan
  25. asin = math.asin
  26. acos = math.acos
  27. abs = math.abs
  28. e = math.exp(1)
  29. --ok trig
  30. csc = function(aX) return 1/math.sin((aX)) end--no-one even uses these but whatever, it actually
  31. --works, and you can try it, but itll lag for this revision because of the infinite limits/asymptotes
  32. sec = function(aX) return 1/math.cos((aX)) end
  33. cot = function(aX) return 1/math.tan((aX)) end
  34. exp = function(aX) return math.exp((aX)) end
  35.  
  36.  
  37. differentialsurface = false--truly depreciated by now
  38. --dont mess with anything else unless you are very experienced in both lua and mathematics
  39. --and obviously, visualizing; all except delta, variable...
  40. --Feel free to edit the equations below...explained shortly
  41. gui = Instance.new("ScreenGui",game.StarterGui)
  42. boxp = Instance.new("TextButton",gui)
  43. v1 = Instance.new("TextBox",gui)
  44. v2 = Instance.new("TextBox",gui)
  45. boxp.Size = UDim2.new(0.2, 1,0.05, 1)
  46. v1.Size = UDim2.new(0.2, 1,0.05, 1)
  47. v2.Size = UDim2.new(0.2, 1,0.05, 1)
  48. v1.Position = UDim2.new(0, 0,0.5, 0)
  49. v2.Position = UDim2.new(0, 0,0.7, 0)
  50. local current_pointer = Instance.new("BillboardGui")
  51. local txt = Instance.new("TextBox",current_pointer)
  52. local current_pointer2 = Instance.new("BillboardGui")
  53. local txt2 = Instance.new("TextBox",current_pointer)
  54. simpsons =true
  55. --next up: df/dt. where df is a desired tangent variable...LOL.
  56. --current_pointer.Size = UDim2.new(.01,0,.01,0)
  57. --current_pointer.StudsOffset = Vector3.new(0,3.5,0)
  58. nopoints = true
  59. contour = true
  60. local modl = Instance.new("Model",workspace)
  61. x,y,z=0
  62. --tangent = Instance.new("Part",modl)
  63. og = game.Workspace[studier].Head.Position
  64.  
  65. local axis = Instance.new("Part",modl)
  66. axis.formFactor = "Custom"
  67. axis.BrickColor = BrickColor.new(1,0,0)
  68. axis.Size = Vector3.new(30,0,0)
  69. axis.CFrame = CFrame.new(og.x+10,og.y+10,og.z+10)
  70. axis.Anchored = true
  71. local zax = axis:clone()
  72. zax.Parent = modl
  73. zax.Size = Vector3.new(0,0,30)
  74. zax.formFactor = "Custom"
  75. zax.BrickColor = BrickColor.new(0,0,1)
  76. zax.CFrame = CFrame.new(og.x+10,og.y+10,og.z+10)
  77. zax.Anchored = true
  78. local azax = axis:clone()
  79. azax.Parent = modl
  80. azax.Size = Vector3.new(0,30,0)
  81. azax.formFactor = "Custom"
  82. azax.BrickColor = BrickColor.new(0,1,0)
  83. azax.CFrame = CFrame.new(og.x+10,og.y+10,og.z+10)
  84. azax.Anchored = true
  85. local roy = .6--delta
  86. Q = og
  87. for i = d1,d2, roy do --for k = d1,d2,roy do-- for k = d1,d2,roy do
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. --[[ R E A D H E R E !!!--]]
  96.  
  97. --Feel free to edit the equations use regular parameters as listed, so if like
  98.  
  99. --you want to graph z = ln x / ln y, you type z = ln(x)-ln(y). Not too bad is it?
  100.  
  101. --Just remember y is not actually defined, use z and x instead.
  102. --Of course, ignore the local variable suggestion >.>
  103. --finally, no more .math for EVERY PREFIX
  104. function Hx(x)--to avoid a true mess, this is universally....either for dFsub3
  105. yd =10
  106. xd = x
  107. zd =0
  108. local vec = Vector3.new(xd,yd,zd)
  109. return vec
  110. end
  111.  
  112.  
  113. function function3d(x)--tripleintegral[a,b]x[g(x),h(x)]x[h(x,y),g(x,y)]dV=V,this is universally either
  114. yd = sin(x)
  115. xd =x
  116. zd =0
  117. local vec = Vector3.new(xd,yd,zd)
  118. return vec
  119. end
  120.  
  121.  
  122. hy = Hx(i).y
  123. hx = Hx(i).x
  124. hz = Hx(i).z
  125. --
  126. y = function3d(i).y
  127. x = function3d(i).x
  128. z = function3d(i).z
  129. y2 = function3d(i+roy).y
  130. x2 = function3d(i+roy).x
  131. z2 = function3d(i+roy).z
  132.  
  133.  
  134.  
  135. del = roy
  136. function derivative(aq,aj)
  137. limit = (aj-aq) / del
  138. print(limit)
  139. return limit
  140. end
  141. derivative(function3d(i).y,function3d(i+del).y)
  142.  
  143.  
  144. nextD=derivative(function3d(i),function3d(i+del))
  145. normD = derivative(function3d(i+roy),function3d(i+roy+del))
  146.  
  147. --we discuss y=f(a+h)-f(a) / h (i - a) + f(a) because of dh/dx = h'
  148.  
  149.  
  150. function Tx(x,del,XC)--to avoid a true mess, this is universally....either for dFsub3
  151. yd =((function3d(XC + .005).y - function3d(XC).y )/ .005)* (x-XC) + function3d(XC).y
  152. print"h1"
  153. print(((function3d(XC + del).y - function3d(XC).y )/ .05))
  154. --print(function3d(XC).y)
  155. print"h"
  156. xd = x
  157. zd =0
  158. local vec = Vector3.new(xd,yd,zd)
  159. return vec
  160. end
  161. XCORD = 2
  162. delta = .1
  163. functionS = function3d
  164.  
  165. --y3primenext = derivative(derivative(function3d(i)),derivative(function3d(i+del)))
  166. --y3primenorm = derivative(derivative(function3d(i+roy)),derivative(function3d(i+roy+del)))
  167.  
  168.  
  169. function makedifferentialslope(Fx,Fy,Fz,NFx,NFy,NFz,COL)
  170. as2 = Instance.new("Part",modl)
  171. as2.FormFactor = "Custom"
  172. as2.Anchored = true
  173. as2.BrickColor = BrickColor.new(0,255,0)
  174. as2.Size = Vector3.new(1,1,1)
  175. local mh = Instance.new("BlockMesh",as2)
  176. mh.Scale = Vector3.new(roy,roy,roy)
  177. as2.Position = Vector3.new(og.x+NFx+10,og.y+NFy+10,og.z+NFz+10)
  178. as2.CanCollide = false
  179. as2.CFrame = CFrame.new(Vector3.new(og.x+NFx+10,og.y+NFy+10,og.z+NFz+10),Vector3.new(x2,y2,z2))
  180. as2.Transparency = 1
  181. local locus = Instance.new("Model",modl)
  182. local locush = Instance.new("Humanoid",locus)
  183. local ax = Instance.new('SelectionPartLasso',as2)
  184. as2.Parent = locus
  185. ax.Humanoid = locush
  186.  
  187. ax.Visible = true
  188. ax.Color =COL
  189. as2.Parent = locus
  190. as2.Name = "Torso"
  191.  
  192. local ahy = as2:clone()
  193. ahy.Parent = locus
  194. ahy.Name = "ok"
  195. ahy.CFrame = CFrame.new(og.x+(Fx)+10,og.y+(Fy)+10,og.z+(Fz)+10)
  196. ax.Part = ahy
  197.  
  198. if og.y+(Fy)+10 > 55 or og.y+(Fy)+10 < -(55) then
  199. locus:Destroy()
  200. end
  201. end--BrickColor.new(0+(NFy/(NFy-.5))*.93,0+(NFy/(NFy-.5))*.41,0+(NFy/(NFy-.5))*.95)
  202. makedifferentialslope(x2,y2,z2,x,y,z,BrickColor.new(1,0,0))--this truly saves a ton of space
  203. makedifferentialslope(x2,normD.y,z2,x,nextD.y,z,BrickColor.new(1,0,.6))--this truly saves a ton of space
  204. XC = math.pi/2
  205. makedifferentialslope(x2,((function3d(XC + .005).y - function3d(XC).y )/.005)* (i+delta-XC) + function3d(XC).y,z2,x,((function3d(XC + .005).y - function3d(XC).y )/.005)* (i-XC) + function3d(XC).y,z,BrickColor.new(1,.7,1))--this truly saves a ton of space
  206.  
  207. print(Tx(i +roy, .2, 2).y)
  208. --makedifferentialslope(x2,y3primenorm.y,z2,x,y3primenext.y,z,BrickColor.new(1,1,0))--this truly saves a ton of space
  209. wait(.1)
  210. end
  211.  
  212.  
  213. wait(90)
  214. modl:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement