Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. Post a replyTopic review (newest first)
hi peeps not bin on 4 ages and stsrted bak at school today
Those are two very nice calculators! I'm impressed. I started writing my large digit calculation program yesterday, so I'll continue with that. Plus, I'm not very good at examining programs written by others, and I like writing things from scratch.
Or ...
Well I wrote a perfectly working function for sine but my compiler is screwing up. :-( Its a pretty cool function though.
The following web page says you can use any value of x in the cosine summation and the sine too.
Might be a good idea to first automaticly reduce the arguement. I don't know this languagel but, as the first step of the function, in C++ you could just say
It works in all four quadrants, but the floating point math isn't that precise in this language I used
Code looks right to me. Does it work in all quadrants (90° to 360°) ?
I wrote this in Just BASIC v1.0. Code:'Note: dangle is angle in degrees and rangle is angle in radians for dangle = 0 to 90 step 5 pi = 3.141592653589793238462643383279502884197169399375105820974944 rangle=(pi*dangle)/180 'Note: cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + ... rangleSqrd=rangle * rangle diver = 0 nextTerm = 1 cosineNow = 1 for iter=1 to 10 for d1 = 1 to 2 diver = diver + 1 nextTerm = nextTerm / diver next d1 nextTerm = 0 - nextTerm nextTerm = nextTerm * rangleSqrd cosineNow = cosineNow + nextTerm next iter print "Cosine( ";dangle;" ) = ";cosineNow next dangle
"^" means to raise to a power. It's necessary on plain text documents that don't support superscripts. It's also an operator in many programming languages, including, I think, C/++, so you can use it in your programs to raise things to a power.
Hmm...what does "^" mean? Is that something used in calculus or something? Never enountered it in my math book.
It is better to remember "TOA CAH SOH". It means "fat old woman" in hokkien (If I remember correctly ).
This may help.
I would like to right some simple C++ programs to do some vector calculations and stuff but I need a way to calculate sine, cosine and tangent. I take it most computers have the formula's built in somewhere but I think it might be educational (mathematicly) and good programming practice to write my own algorithm. I've seen a few differant formulas for more or less accurate calculations on the internet but the explanations are often quite confusing. Using words to express yourself is not what mathematicians do best. |