Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3279388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:35:13+00:00 2026-05-17T19:35:13+00:00

I was making a utility to quickly create CSS drop shadows, and realized that

  • 0

I was making a utility to quickly create CSS drop shadows, and realized that this can only be done in IE with IE filters. However, the Shadow Filter uses Direction instead of (x, y) coordinates:

filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');"

How can Direction be calculated from (x, y) coordinates?

Edit: Using the responses given and more details from this link: 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:35:13+00:00Added an answer on May 17, 2026 at 7:35 pm

    Direction is in degrees.

    So

    x = cos(direction)
    y = sin(direction)
    

    If your calculator works in radians (as any sane calulator should), you can convert degrees to radians with

    radians = degrees / 180 * pi
    

    where pi = 3.14159… or Math.PI

    To go the other way, use ‘atan’

    radians = Math.atan(y / x)
    

    In Javascript you have a Math.atan2 function which takes y and x as parameters.

    radians = Math.atan2(y, x)
    

    radians to degrees is:

    degrees = radians / pi * 180
    

    so the result is:

    direction = Math.atan2(y,  x) / Math.PI * 180
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making this tiny utility program (Windows Forms) and it would need to save
I am making a PHP utility that imports and analyzes a CSV file into
This should be simple. I'm making a very basic app, based on the Utility
This is beyond both making sense and my control. That being said here is
I'm making a wxpython app that I will compile with the various freezing utility
I'm playing with the idea of making a completely JavaScript-based zip/unzip utility that anyone
I'm thinking about making a networked game. I'm a little new to this, and
I'm making a WinForms app with a ListView set to detail so that several
I'm just making a small utility with a local HTML file ( checker.htm )
I'm making a simple little utility while learning Python. It dynamically generates a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.