• Fading in and out with math.sin()?
    2 replies, posted
I haven't taken trigonometry classes yet so this really stumped me. I've been trying to fade an object in and out using the following formula... [code] alpha = math.Clamp(200 + ((math.sin(CurTime()) * 100), 200, 255) [/code] It works, but I just don't understand math.sin(). It only ranges from -1 to 1, but I though there were multiple radians in a 360 degree circle and even using colossal numbers it stays the same. So, can anybody give me an explanation, please?
Sin(ang) returns the length of the opposite side of a triangle created inside a unit circle (radius of 1) where the hypotenuse is at ang radians. [img]http://i44.tinypic.com/67i7ib.jpg[/img] Because the unit circle has a radius of 1, the opposite side will oscillate from 1 to -1.
Ah...I appreciate it.
Sorry, you need to Log In to post a reply to this thread.