Computer Science Canada

cos and sin

Author:  jonos [ Wed Feb 18, 2004 6:25 pm ]
Post subject:  cos and sin

i have seen these used a lot, and if its not too much trouble, could someone please explain these and what they do. im only starting grade 10 math, so i don't know.

Author:  Paul [ Wed Feb 18, 2004 6:54 pm ]
Post subject: 

They're used in trig, you can use them in solving for parts of a triangle if certain other parts are known. I think only in right angeled triangles:
sin(angle) = opposite / hypotenuse
cos(angle) = adjacent / hypotenuse
haven't reached that unit yet, remebered from some book 2 summers back... that I was made to study...

Author:  Tony [ Wed Feb 18, 2004 7:06 pm ]
Post subject: 

Sin/Cos/Tan are ratios formed between the sides of the triangle in relation to an angle. If you know an angle and 1 side, you can find all other sides using trig.

Sin/Cos/Tan functions are applied to the right angle triangle, but you can use special ratios in any triangle.

a^2 = b^2 + c^2 - 2bc CosA

where a,b,c are the sides and A is the angle opposite of the side a

also

SinA/a = SinB/b = SinC/b

Author:  jonos [ Wed Feb 18, 2004 7:27 pm ]
Post subject: 

thanks for explaining it, but is there any where where i could get a more simpler definition/use

Author:  Tony [ Wed Feb 18, 2004 8:26 pm ]
Post subject: 

grade 10 math textbook Laughing

Author:  shorthair [ Wed Feb 18, 2004 9:25 pm ]
Post subject: 

its hte final unit in math , it makes the course relaxing after quadratices, good way to end hte year / semester ... trignometry is fun and good for programming

Author:  Tony [ Wed Feb 18, 2004 9:55 pm ]
Post subject: 

trig is neccessary for programming Laughing

lol, quadratics... that's the easy stuff... just wait till calculus Laughing

Author:  shorthair [ Wed Feb 18, 2004 10:02 pm ]
Post subject: 

in in funtions and relations right now , caculus isnt that dificult ( begginers 0 i was looking at it online couple weeks ago the coursse in grade 12 dosent go very indepth

Author:  Tony [ Wed Feb 18, 2004 10:07 pm ]
Post subject: 

well at first its advanced functions... you don't get into the real calculus for a while...

but apparently its really useful in physics pass highschool

Author:  Catalyst [ Wed Feb 18, 2004 10:08 pm ]
Post subject: 

calculus isnt that hard (it still is fairly hard tho)

Author:  shorthair [ Wed Feb 18, 2004 10:10 pm ]
Post subject: 

i quite like functions , i love number secuences aswell in math , the fibionacci geometric and arithmeic i have found very useful

Author:  octopi [ Thu Feb 19, 2004 12:45 am ]
Post subject: 

Calculus was hard.
Algebra is hard.

I love both of them
Data Management is a boring pain in the neck.

Author:  Catalyst [ Thu Feb 19, 2004 7:04 am ]
Post subject: 

well said

Author:  AsianSensation [ Thu Feb 19, 2004 7:51 am ]
Post subject: 

octopi wrote:
Data Management is a boring pain in the neck.


that's why you take it in gr 11 so you won't be bored as much as you would in gr 12. But's Finite is a good course to take, very useful in solving problems. Yeah, I know, with computer science, you could just write up a program and do a probability question by repeatedly running that program, but the matrices and probablity theory you learn is not bad at all, and very very useful.

Author:  apomb [ Tue Feb 24, 2004 6:43 pm ]
Post subject: 

I was wondering if Geometry/Discrete Math is useful for programming ... and if it is / not ... what does it teach you ?

Author:  Paul [ Tue Feb 24, 2004 6:58 pm ]
Post subject: 

lol, all I know about that course is I have to take it, and its supposably the most difficult math course in the ontario high schools.

Author:  Maverick [ Tue Feb 24, 2004 10:30 pm ]
Post subject: 

Thats an affirmative on that. Yes discrete math is good for prog, cause it teachs you angles and all the shiz, along with physics

Author:  jonos [ Wed Feb 25, 2004 4:43 pm ]
Post subject: 

what's discrete math... whats the source code?

is that the 3u math course, because that is the hardest grade 11 math course and everyone is saying it's really hard and how they had to get a tutor to just get 75% in it. is it really that hard?

Author:  Maverick [ Wed Feb 25, 2004 4:45 pm ]
Post subject: 

Well ppl who need tutors shuldnt be taking U courses. No that is 4U, at my school at least.

Author:  Paul [ Wed Feb 25, 2004 5:09 pm ]
Post subject: 

Hehe, its MGA 4UI I think (grade 12), and tutors are useless, me excluded Very Happy, one person I tutored went from 60% to 85% Very Happy. But I'm in grade 10 and I have 102%, though it only shows 100 on the report card Sad I'll have to take AP calculus along with MGA course in grade 12, along with chemistry and physics, its cause I'm asian (my parents will whip me) and I wanna go into engineering. Very Happy

Author:  Maverick [ Wed Feb 25, 2004 6:59 pm ]
Post subject: 

You know you're a |\|ERD when ^^^^^
102% WTF is that? What course?

Author:  zylum [ Wed Feb 25, 2004 7:01 pm ]
Post subject: 

lol, it's not that hard to get over 100% in grade 10 math...

Author:  Maverick [ Wed Feb 25, 2004 7:04 pm ]
Post subject: 

Uhh. K, best mark in grade 10 for us was 98%.
Hmm i got 72% but math is the root of all evil, and i never studied or did homework.

Author:  jonos [ Wed Feb 25, 2004 8:07 pm ]
Post subject: 

no one in my school can get over 99 because no one is perfect, even if they get perfect on tests. no one's communication marks should be perfect because that is not possible how they have it set up. the highest mark was around 93% and i was one mark below that, but i don't see how people can get over 100% because the way it is set up at my school it's impossible. even if you get close to that on all the test, you still can't get over 95%.

some schools are just weird.

Author:  Paul [ Wed Feb 25, 2004 8:23 pm ]
Post subject: 

Bonus Very Happy extra credit, ez too. No stupid and careless mistakes either

Author:  Maverick [ Wed Feb 25, 2004 9:28 pm ]
Post subject: 

Still 102%. holy crap.

Author:  Acid [ Thu Feb 26, 2004 10:34 am ]
Post subject: 

tony wrote:
SinA/a = SinB/b = SinC/c


Not to be anal-retentive, but you got that backwards.

a/SinA = b/SinB = c/SinC

Another use for these functions is when studying waves. Light and alternating current electricity are examples of sinusoidal waves.

Author:  apomb [ Thu Feb 26, 2004 4:33 pm ]
Post subject: 

It doen's Matter what way you put it!!! they still come out to be the same thing! Only its kinda easier to use SinA/a = SinB/b = SinC/c when finding an angle and a/SinA = b/SinB = c/SinC when finding sides.

Author:  thegoose [ Mon Jun 21, 2004 10:25 am ]
Post subject: 

Trig problems generally don't appear on computational geometry problems. Instead, vectors seem to be favored by some recent contests a lot. This is probably because trig generates ugly real numbers while vector still can keep everything as integers.

Author:  Cervantes [ Mon Jun 21, 2004 3:10 pm ]
Post subject: 

Maverick wrote:
You know you're a |\|ERD when ^^^^^
102% WTF is that? What course?

hey! back off! I'm getting 102% also Laughing
but really, 102 isn't all that great. thats a 93 before being multiplied by 1.1. my friend is getting 108%. Laughing

Author:  Paul [ Mon Jun 21, 2004 5:39 pm ]
Post subject: 

Person who won math award for the grade: 126% Shocked did NOT know that was possible.

Author:  Cervantes [ Mon Jun 21, 2004 7:40 pm ]
Post subject: 

wow. that's a lot. Confused what was his mark multiplied by to get there?!

this is getting a bit offtopic, so ill bring it back. Smile Cervantes to the rescue.

using trig, how would you go about creating a program that has a ball sitting on a ramp and, when pressing the arrow keys, the ramp angles itself up or down. then, depending on how the ramp is angled, the ball rolls down it at the proper speed, according to the laws of physics.

in case anyone didn't understand my blurb, it should look something like this:
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Author:  Tony [ Mon Jun 21, 2004 8:01 pm ]
Post subject: 

i hope this helps

figure out Fx and Fy... and that's what you apply to the ball

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Author:  Cervantes [ Tue Jun 22, 2004 7:48 am ]
Post subject: 

oops, I probably should have mentioned that I've already done this, and am asking how you guys would do it.
I sort of cheated. In my program the ball doesn't roll down the slope so much as makes tiny bounces all the way down it.
tony, the green line in your drawing, is that the path of the ball if it were not to hit the slope? sorry I don't really understand your drawing Confused

Author:  zylum [ Tue Jun 22, 2004 1:58 pm ]
Post subject: 

the normal (the green line) is just a perpindicular line to the slope

Author:  Tony [ Tue Jun 22, 2004 5:06 pm ]
Post subject: 

normal force is the force that the slope applies to the ball.

Fx is the force which pushes the ball to the side
Fy is the force with which the ball is being pushed vertically up. But when added with the Fg (gravity), then theoretically the ball should be kept rolling on the slope

Author:  GlobeTrotter [ Tue Jun 22, 2004 6:02 pm ]
Post subject: 

I tried to put an example together, are these the right mathematics?

code:

setscreen ("graphics:400,400;offscreenonly")
var mx, my, mb : int
var pointx, pointy : array 1 .. 2 of int
var clicked : int
var x, y, vx, vy, grav : real := 0
var collision : boolean := false
var m, b : real
x := 200
y := 120
grav := 0.001
pointx (1) := 0
pointy (1) := 100
pointx (2) := 400
pointy (2) := 100
loop
    cls
    mousewhere (mx, my, mb)
    drawline (pointx (1), pointy (1), pointx (2), pointy (2), 7)
    drawoval (pointx (1), pointy (1), 5, 5, 7)
    drawoval (pointx (2), pointy (2), 5, 5, 7)
    drawfilloval (round (x), round (y), 10, 10, 4)
    if round (Math.Distance (pointx (1), pointy (1), mx, my)) <= 25 and mb = 1 then
        clicked := 1
    elsif round (Math.Distance (pointx (2), pointy (2), mx, my)) <= 25 and mb = 1 then
        clicked := 2
    else
        clicked := 0
    end if
    if clicked ~= 0 then
        pointx (clicked) := mx
        pointy (clicked) := my
    end if
    y -= vy
    vy += grav
    m := (pointy (1) - pointy (2)) / (pointx (1) - pointx (2))
    b := pointy (1) - m * pointx (1)
    if collision then
        x -= m
        vy := 0
        y := m * x + b
    end if
    if round (y) = m * x + b then
        collision := true
    end if
    View.Update
    exit when hasch
end loop

Author:  zylum [ Wed Jun 23, 2004 10:09 am ]
Post subject: 

i dont think those are the correct physics... for one thing, i dont see any friction in your code so therefore the ball should constantly be accelerating down the slope. if there were friction there would be a terminal velocity where the ball could no longer accelerate because of friction. another thing is that the ball has no inertia. so when the ball is moving quickly to the left and then you level the surface, it should keep moving in that direction.


: