Hey, this just derived from Microsoft, suprise, suprise. I was just making a little util to quickly do drop shadows with CSS, and realized that it can only be duplicated in IE with filters. The Shadow filter however uses direction instead of x, y coordinates.
filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');"
any idea how to calculate the direction from x,y coordinates?
EDIT##################################33 Using the responses given and more details from this link: http://www.teacherschoice.com.au/Maths_Library/Angles/Angles.htm, I modified my code as follows:
function(x, y){
var d = Math.atan2(x, y) * (180 / Math.PI);
if(d < 0){ d = 180 - d; }
return d;
}
If you pass in Horizontal Offset and Vertical Offset that you would use as X, Y respectively, you will get a degree from 0 to 359