(SEE ATTACHED PROJECT) Ok, I have some light (the blue line on the right) coming through a substance, hitting another substance, and refracted at a certain angle (the blue line on the left). You enter the density of the second material in the text box, and choose the angle the light is hitting the second material (with the scroll-bar). Now the blue line on the left is suppose to move with the blue line on the right. Which is working... but not the right way! Proof: if you put the second material's density to 1, the light should NOT be refracted, but if you look at the blue line, when you come to an angle of 60 or so, it does start being refracted! And at an angle of like 65 the app gives me an error. PLEASE help me find what the problem is, I am getting desperate, this school project is for tomorrow.
"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
"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
It's producing a negative value which, of course, can't be square rooted without producing an imaginary number. Inverse tangent may actually be able to use imaginary numbers (I'm not sure on that, though), but VB doesn't like them. What is the formula you've been supplied with?
Edit: It just hit me why that's not working: arcsin has a domain of -1 to 1 because that's the range of sin, so passing it a value of x greater than 1 or less than -1 will cause an error like that. Again, I'd have to see the formula to help.
Last edited by jemidiah; Dec 12th, 2003 at 12:47 AM.
The time you enjoy wasting is not wasted time. Bertrand Russell
if I remember right, when you get an error when tryingto calculate that, it means the light was... absorbed, or travelling parrallel to the surface, or something like that... just use error checking
Don't pay attention to this signature, it's contradictory.