|
Page 1 of 1
|
[ 11 posts ] |
|
| Author |
Message |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
I was hoping I could assistance in converting the fighter and shield formula frome Excel to scripting use. My knowledge in math is limited and have been struggeling with this. I finally found what I am assumising it the actual sine formula and now it is even more confusing with the ‘n!’ and ‘…’ functions playing a part in the formula, I have been messing with it on a calculator and do not seem to be getting a handle on it. I included the definitions for the functions, which I have been trying to go by, unsuccessfully, heh. I was also hoping to apply something for holds price changes as well. Additionally, I was wondering that past reference to 00:00 1/1/4004 BC was that a serious or meant to be a joke?
SIN x = x – x3/3! + x5/5! – x7/7! + …
x = Number of Days Past since: (12:00 (Noon) 1/14/2003)/180*3.14159
(NOTE – the formula mentioned converting x to a radian by dividing the number by 180 and then multiplying that by PI.)
Mathematics (n!)In mathematics the symbol represents the factorial operation. The expression n! means "the product of the integers from 1 to n". For example, 4! (read four factorial) is 4 × 3 × 2 × 1 = 24. (0! is defined as 1, which is a neutral element in multiplication, not multiplied by anything.)
Ellipsis in mathematics (…)
The centred ellipsis is also often used in mathematics to mean “and so forth,” e.g.,
1+2+3+…+100
means the sum of all natural numbers from 1 to 100. However, it is not a formally defined mathematical symbol. These dots should never be used unless the pattern to be followed is clear. Another example is the set of zeroes of the cosine function.
{ +/- PI/2, +/- 3PI/2, +/- 5PI/2, …}
This is in reference to:
quote: Originally posted by Cherokee-TLTT
Fig prices: 200 + (SIN((X)*(PI()/43.7725))*40)
Shield prices: 150 - (SIN((X)*(PI()/43.7725))*40)
... where X is the number of calendar days that have passed since 12 noon on 1/14/2003 (my reference date)
Local testing has shown me that these will still be accurate to within about 1/2 a credit 10 years from now, very very slowly diverging away from complete accuracy as of 1/14/2003.
Don't ask me how I figured this out. I'm just THAT smart. heh.
quote: Originally posted by Kavanagh
If you use 00.00 hours Jan. 1st 4004 BC as the base date, your formula is completely accurate, for eternity 
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!
|
| Mon May 08, 2006 1:57 am |
|
 |
|
Kavanagh
Ambassador
Joined: Wed Feb 28, 2001 3:00 am Posts: 1410 Location: Boo! inc. Ireland
|
Your formula for sine is correct. My 4004 date was a joke. A 19th century English Bishop calculated that date as the Day of Creation, based on data from the bible. Many Creationists accept it as a fact to this day.
I dont understand your question however, are you asking for a script to calculate sine? If so, what language.
CK's formula will give max min prices for figs as 240/160 and shields 190/110. This appears to be within a credit of what you found when you experimented.
|
| Mon May 08, 2006 6:25 pm |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
Darn it Kav! you had me going on that one, ROFL! I knew it was too good to be true, though. [:P]
Yes, I was looking for a way to convert it to mainly TWX or really any way that just uses the basic *, /, +, - functions. How did CK pull it off in his script? I don't have any of his scripts, unfortunately.
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!
|
| Mon May 08, 2006 8:03 pm |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
Leap years also need to be considered during this process, right? I was trying to figure out why the formula is slowly being offset and was wondering if that could be the reason? As 2004 was the last leap year and the formula was made during 2003 and the next leap year is 2008, so I am not sure? Something I though was interesting was that as you do the calculations from one leap year to the next the decimal increases each year by .25 until the next whole number (or leap year) is again reached, as well the resulting whole number from the division will increase by the one whole number from the previous leap year, i.e. 501, 502, 503, etc.
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!
|
| Mon May 08, 2006 10:24 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
Laff, you're not going to be able to do this w/ primary functions. You'll need to build a sine chart array and a years-to-days array and go from there.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Mon May 08, 2006 11:06 pm |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
How did CK manage to pull it off then?
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!
|
| Mon May 08, 2006 11:28 pm |
|
 |
|
kilroy
Chief Warrant Officer
Joined: Mon May 16, 2005 2:00 am Posts: 155 Location: USA
|
Actually I created the earth on feb 3rd 4006 BC. The date was mis-translated
|
| Tue May 09, 2006 2:03 am |
|
 |
|
Kavanagh
Ambassador
Joined: Wed Feb 28, 2001 3:00 am Posts: 1410 Location: Boo! inc. Ireland
|
quote:Originally posted by RexxCrow
Darn it Kav! you had me going on that one, ROFL! I knew it was too good to be true, though. [:P]
Yes, I was looking for a way to convert it to mainly TWX or really any way that just uses the basic *, /, +, - functions. How did CK pull it off in his script? I don't have any of his scripts, unfortunately.
I cant write it twx, I dont use it. ZOC, Qmodem, Telix SALT, could write, using the basic operators. ZOC REXX might even have built in trig functions.
Bishop Ussher figured 4084 BC I think - I wrote 4004 BC (2002 x 2) as part of the joke.
|
| Tue May 09, 2006 4:04 am |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
Heh, I couldn't resist.
I've written a Sin.ts script that can be called as an include quite easily. Posted on Grimy, along with an example calling script to demonstrate include usage.
I'll probably go ahead and script the rest of the Fig/Shield calculation script too, just not tonight.
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Tue May 09, 2006 7:08 am |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
CK didn't pull it off as far as I know. His fig/shield calculator is on his website, and isn't calculated using TWX Proxy. I don't know of any of his scripts that did it in TWX.
I actually have an absolute date-to-day conversion routine that will do the necessary conversion, including leap years and what not. Never had much use for it before now. Just wrote it as a proof-of-concept a year or so ago. But it'll be perfect for the rest of the calculation. I'll release it along with a final fig/shield calculation script, sometime later this week.
RexxCrow, you owe me
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Tue May 09, 2006 7:22 am |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
Heh outstanding EP, once again you prove how much of a genius you are! I can’t wait to try and Chinese Wall it! Thank you for working on this, honestly it would probably taken me… well let’s just say a lot of time vested, before I would have even started getting a handle on it all. [;)]
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!
|
| Tue May 09, 2006 7:42 am |
|
 |
|
|
Page 1 of 1
|
[ 11 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 18 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|