Qbasicnews.com

Full Version: Trigonometry
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Make a program that calculates the sine of an angle without using the SIN function. Here are the rules:

No SIN function (duh)
Like the statistical challenge, make it as a function
Hardware stuff is allowed, libs are not
It should be accurate to at least 8sf
Points will be awarded for speed and size of code as well as accuracy

Do not post code here just yet, or post hints, but email me the prog (twotowers@ihug.co.nz).

If there is little interest, the rules will change. Have fun!
Um, that's really easy if you can use the other trig ratios...
Yep. TAN(a) = SIN(a)/COS(a), so it is not a very difficult task.

Also, having to email the proggie is a bummer ... Sad why not posting it here? (I have to open hotmail, blah blah blah and it always works bad)
Quote:Yep. TAN(a) = SIN(a)/COS(a), so it is not a very difficult task.

Also, having to email the proggie is a bummer ... Sad why not posting it here? (I have to open hotmail, blah blah blah and it always works bad)

OH NOES!11!!!11!

OMG you gave away the secret answer!!!1!!1!



Actually I'd forgotten that QB actually has a TAN function. I think the Pascal manual instructs you to calculate a TAN using SIN/COS, which I always thought of as rather inefficient... fortunately you'd never in a practical situation use anything but SIN, COS, and ATN.
well, while we're giving away "secret" trig identities, here's a good one:

sin(theta) = cos(.5pi - theta)
Paging Glenn......
Paging Glenn......

Paging Glenn..... To post his "False Positioning" method of solving Trig functions..... Paging Glenn.....


:*)
Quote:well, while we're giving away "secret" trig identities, here's a good one:

sin(theta) = cos(.5pi - theta)

OH NOES!!11!!1!!! [Image: eek.gif]


sin ^ 2 = 1 - cos ^ 2
OK, since you guys are being such smarta$$e$... sorry, it's really my fault. Revised rules:

No trig functions. I want to see the *real* way that the sin function is calculated. Go out and Google it to see if you can find the real way.

The reason I don't want people posting code is because once someone finds the *real* way then everyone else is gonna just rip it.

Wait, no... I forgot.

I am rating this challenge through an arbitary method where each entry gains "challenge points". This simply means that if you submit a good entry, you will gain many challenge points, and if you submit something bad you won't gain as many. The measure is *completely* arbitary, so don't go submitting something really bad loads of times to try to get heaps of points. In any event, you can now post code here, but do it quick cos the actual formula is worth loads of challenge points.

Toonski84 is the leader, he submitted the code that made me realise that the challenge rules wern't up to scratch. But it works so he has 3 challenge points, he is winning.

ps: alternatively, you can submit code to me, I will review it and tell you how much you get, and your method stays secret. However, you risk someone else finding the formula and displaying it to the world and gaining big points if you do this.

Once again, sorry about the rules. Now get posting!
too late!!! Glenn did that already. Wonder why he isn't replying.
Maybe he sent it in privately. Or maybe he didn't...

Just send them in guys!

I'm reviewing toonski's second entry as I do this!
Pages: 1 2 3 4