Posted: Mon Oct 07, 2002 9:53 am Post subject: simple trig functions in turing
just some simple use of trigonometry functions in turing for you lucky arses that got to take comp sci before grade ten when you're supposed to learn trig. show this to your classmates that can't do things like this and then call them n00bs as they watch in amazement. j00 r teh l337 now!
code:
% learn trig in grade 10 mathematics
include a real programming language
Sponsor Sponsor
Tony
Posted: Mon Oct 07, 2002 10:38 am Post subject: (No subject)
That's the trig portion. The ball's x coordinate is the cosine of it's angle multiplied by hyp, it's hypotenuse (the distance from the middle). Same for y coordinate, just with sine.
Man, old post. And your avatar is big, let's change that please.
netninja
Posted: Wed Sep 15, 2004 5:53 pm Post subject: (No subject)
completely useless:
code:
if angle (i) = 360
then
angle (i) := i
end if
AsianSensation
Posted: Wed Sep 15, 2004 6:24 pm Post subject: (No subject)
what makes you say that?
the original code is
code:
if angle (i) = 360
then
angle (i) := 72 * i
end if
So it means, when one rotation is completed, the initial angle is resetted to one of the five spots.
Mazer
Posted: Wed Sep 15, 2004 6:29 pm Post subject: (No subject)
A long time ago in a galaxy far far away, I'm sure I meant to use that as protection from integer overflow. Though it should've been angle (i) >= 360.
But thanks for bringing that up, I'm sorry if I scarred your learning of trigonometry. Please see signature.