Results 1 to 7 of 7

Thread: physics, laws of refraction

  1. #1

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    physics, laws of refraction

    I need help getting started here. I have two subtsances and light going through both of them. For those who remeber their physics, the light will be refracted with snell-decartes' law. Now I'm trying to represent this on a form, with a line.
    Something like the project attached, but I have to recode it myself. Where do I start? My interface is already done.

    Thx in advance
    Attached Files Attached Files
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    I'm abit wary of exe's so i'm not gonna run the attached prog, sorry.

    What stuff does snell-dertes law give you? An outgoing angle (relative to material divide) given an incoming one? (assuming the density/whatever of the materials are known)


    What stuff do you want your program to do? Allow the user to draw vector (line), have it extended to the material devide, and continue with the correct direction?

    If so there are several things you're gonna need.

    1) A way of getting user input.

    The mouse events should be fine.

    2) A way of drawing the line.

    Not too difficult, simply calculate the formula of the line (using the 2 points give by the user), then work out where along the x axis it should be when y=0 (top of the pic box), and where it should be when y=height of material divide).

    3) Drawing the line refracted.

    Depending on what the law gives you, this shouldn't be too difficult. It may be a case of simply changing the gradient in the formula, and some x and y values. After that just do something very similar to the first line for drawing it to and from the correct points.


    Hope that helped a bit.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    <QUOTE>What stuff do you want your program to do? Allow the user to draw vector (line), have it extended to the material devide, and continue with the correct direction?</QUOTE>

    Yes exactly, but I want two lines extending from the material deivide.... one like you said. and the other would be the light that is reflected.

    User input, I have a text box, where the user inputs the second material's density. (the first material is 1 by default). I also have a scroll-bar, which the user can use to give the angle the line hits the 2nd material

    The lines are already drawn, but hidden, I guess my program just has to change the X and Y values

    and now I have noooo idea how to start, because I can't play around with angles in VB, only with X1, X2, Y1, and Y2
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  4. #4
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    How do you meen the lines are already drawn, I thought what you were asking was how to work out where to draw them?

    You can use the following to get the angle when given a triangle.

    The opposite (opp) would be the difference in y1 and y2
    The addjacent (adj) would be the difference in x1 and x2
    The Hypotinuse (sp??) would be sqrt(opp2 + adj2)

    tan(angle) = Opp/Adj
    sin(angle) = Opp/Hyp
    cos(angle) = Adj/Hyp

    With the angle i guess you can use the laws of refraction and reflaction to get the outgoing angles. Then just use the formulas above to get from the angle to the correct coordinates.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  5. #5

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    ok thx, could you also just give me the commands of COS SIN TAN SQUARE ROOT and ABS on a computer?
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  6. #6

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    well do they exist?
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  7. #7
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    The VB functions are cos(), sin(), tan() sqr() and abs() respectivly.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width