Qbasicnews.com

Full Version: Sin Cos and Tan (again)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know that I had posted this before, but I didn't get it at all. So could someone either, explain it to me considering that I don't know what SIN COS and TAN is, or send me a link to a tutorial, Math, or QB, that can tell me.
--/|
/-|
/--|
----

WarlordAgamemnus: pi r^2 = area of a circle
WarlordAgamemnus: 2pi r = circumference
WarlordAgamemnus: =)
WarlordAgamemnus: socatoah
WarlordAgamemnus: actually
WarlordAgamemnus: sohatoa
WarlordAgamemnus: no
WarlordAgamemnus: sohatoah
WarlordAgamemnus: ?
WarlordAgamemnus: sohcoahat?
WarlordAgamemnus: no
WarlordAgamemnus: sohcatoah
WarlordAgamemnus: yeah
WarlordAgamemnus: that is it

sine = opposite / hypotenuse
cosine = adjacent / opposite
tangent = adjacent / hypotenuse
An even more helpful post could be to show me how to draw a line that I can change it's angle with the simple change of a variable, while explaining to me what each variably does. I feel confident that this will help me a lot.
um ok

angles:
a
b
c
A
B
C
change the angle, change the line.
-|c --
A| -- C
-|a b--
--------
B

sin© = opp/hyp = B/C
cos© = adj/hyp = A/C
tan© = sin/cos = B/A = opp/adj
Code:
Something doesn't feel right here...

sin(b) = opp/hyp = A/C
cos(b) = adj/hyp = B/C
tan(b) = sin/cos = A/B = opp/adj

sin(a) = opp/hyp = ??
cos(a) = adj/hyp = ??
tan(a) = sin/cos = ??= opp/adj
about them without actually having something to do with them. (Or did I miss something?)
okay, sine/cosine/tangent are all part of a type of math called TRIGONOMETRY (tuh... nitpickers), which is pretty much angles and curves and junk. it's often taught with right triangles because they have special properties.

por ejemple:
[Image: righttri.gif]
your hypotenuse is the long side.
the other two sides are called your legs.

from now on, when we refer to angles, we use cap letters. when referring to sides we use lowercase. i didnt invent this, sorry Tongue

when we say sine of angle A [aka sin(A)] we're referring the leg facing that angle divided by the hypotenuse. or:

sin(A) = a / c (or sin(A) = opp / hyp)

for cosine, we divide the other leg (adjacent) by the hypotenuse:

cos(A) = b / c (cos(A) = adj / hyp)

for tangent, we are basically getting the slope of hypotenuse by saying

tan(A) = a / b (tan(A) = opp / adj)

WHAT THIS MEANS FOR YOU AS AN PROGRAMMER WHO ISNT DOING HEAVY MATHEMATICAL APPLICATIONS OF TRIGONOMETRY:

when you use qb's sin and cos, it basically gives you the length of the opposite and adjacent sides of the triangle if the hypotenenuse is 1. so if i want to say "okay! i want to draw this pixel 10 pixels away 30 degrees from here":

Code:
x = 160 ' coordinate
y = 160

degrees = 30
radians = degrees * pi / 180 'will explain later
length = 10

x2 = cos(radians) * length + x
y2 = sin(radians) * length + y

pset (x2, y2) ' will plot 10 pixels away from center at 30 degrees

obviously, this comes very much in handy when rotating things, or calculating positions, which is why you'll see it so much as a programmer. any time you're dealing with converting angles to coordinates, it'll come in handy as well.

you wont be dealing with this in depth until precalculus in high school, though you will grace the basics in geometry and algebra 2, so it's okay if you dont get all of it. i hope i explained the very, very, very simple basics of trigonometry to you well enough.
Some guy into economics was allowed to influence the "new math." Smile (Back in the dark ages, we called it "trigonometry.")
Ooooh, thanks Toonski, I have a better understanding of this than I did before. At least I actually know what SIN COS and TAN *are*. I can probably use them with basic commands.
hey, if my president can misunderestimate then i can study trigonomics Smile
.