Complex Plotting App
|
02-13-2015, 10:04 PM
(This post was last modified: 02-13-2015 10:06 PM by Han.)
Post: #21
|
|||
|
|||
RE: Complex Plotting App
Your coloring function could be made to run faster. It's essentially the same algorithm repeated three times. Your k value can be computed using logarithms which would be much faster than using a while loop.
Code:
If ranges:=0 and rangee:=C (C is a constant) then we are essentially finding the exponent x such that \(Ce^x < m \le Ce^{x+1} \). \[ Ce^x = m \Rightarrow \ln C + x = \ln m \Rightarrow x = \ln m - \ln C \] Secondly, k:=(m-ranges)/(rangee-ranges) simplifies to: \[ k = \frac{m-Ce^x}{Ce^{x+1}-Ce^x} = \frac{m-Ce^x}{Ce^x(e-1)} = \frac{m}{Ce^x(e-1)} - \frac{Ce^x}{Ce^x(e-1)} = \frac{m}{Ce^x}-\frac{1}{e-1} \] The code could be made smaller by creating a function that computes and returns v. Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)