Difference between revisions of "Template:Cts-solve"
From Tales of Maj'Eyal
								
												
				|  (add the docmentation first) | |||
| Line 1: | Line 1: | ||
| + | {{#expr:( ( {{{high|0}}} - {{{low|0}}} )/( ( {{{x_high|5}}} + {{{shift|0}}} )^ {{{power|0.5}}} - ( {{{x_low|1}}} + {{{shift|0}}} )^ {{{power|0.5}}} )) }} | ||
| <noinclude> | <noinclude> | ||
| Use for solving for [[Template:cts]] for given values. | Use for solving for [[Template:cts]] for given values. | ||
| Line 15: | Line 16: | ||
| </pre> | </pre> | ||
| + | Psuedo code for '''m''': | ||
| + | *'''m''' = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) | ||
| + | * '''Expr for m''': <nowiki>{{#expr:((high-low)/( (x_high+shift)^power - (x_low+shift)^power ))}} </nowiki> | ||
| Input: power(=0), add(=0), shift(=0), x_low (=1), x_high(=5), low, high, (raw or log), t   | Input: power(=0), add(=0), shift(=0), x_low (=1), x_high(=5), low, high, (raw or log), t   | ||
| m = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) | m = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) | ||
| + | |||
| b = low - m*(x_low+shift)^power | b = low - m*(x_low+shift)^power | ||
| Output = m * (t+shift)^power + b + add | Output = m * (t+shift)^power + b + add | ||
| − | |||
| ((high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) * ((t+shift)^power) + (low - ( (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) *(x_low+shift)^power) + add | ((high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) * ((t+shift)^power) + (low - ( (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) *(x_low+shift)^power) + add | ||
| </noinclude> | </noinclude> | ||
Revision as of 14:10, 29 February 2016
0
Use for solving for Template:cts for given values.
{{cts-solve
|high=  
|low=
|t= 
|x_high= (default 5, optional)
|x_low= (default 1, optional)
|power= (default 0.5, optional)
|shift= (default 0, optional)
|add= (default 0, optional)
}}
Psuedo code for m:
- m = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power )
- Expr for m: {{#expr:((high-low)/( (x_high+shift)^power - (x_low+shift)^power ))}}
Input: power(=0), add(=0), shift(=0), x_low (=1), x_high(=5), low, high, (raw or log), t
m = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power )
b = low - m*(x_low+shift)^power
Output = m * (t+shift)^power + b + add
((high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) * ((t+shift)^power) + (low - ( (high - low) / ( (x_high+shift)^power - (x_low+shift)^power ) ) *(x_low+shift)^power) + add


