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 8807193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:18:36+00:00 2026-06-14T02:18:36+00:00

I’m translating some functions from an Excel spreadsheet into python. I need to use

  • 0

I’m translating some functions from an Excel spreadsheet into python. I need to use atan2
which is arctan2 according to numpy docs:
arctan2. The problem is that the two results are not even close:

oc = 23.4384863405
sal = 89.7814630647
sra = np.arctan2(np.cos(np.deg2rad(sal)),
         np.cos(np.deg2rad(oc))*np.sin(np.deg2rad(sal)))
results: Excel = 1.566714757 Numpy = 0.00415720646  ??

I trust the Excel results as it is correct. It is numpy that is wrong.

Now either I’m not using arctan2 correctly, or atan2 is not arctan2 in numpy, or there is a bug in numpy, or I’m just completely lost here.

I’m using python version 2.7.2 and numpy 1.6.2

Any ideas, please?
Thanks

  • 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-06-14T02:18:37+00:00Added an answer on June 14, 2026 at 2:18 am

    From the Excel docs:

    The syntax for the ATAN2 function is:

    ATAN2( x-coordinate, y-coordinate )

    From the numpy docs:

    numpy.arctan2(x1, x2[, out])

    Element-wise arc tangent of x1/x2 choosing the quadrant correctly.

    The quadrant (i.e., branch) is chosen so that arctan2(x1, x2) is the
    signed angle in radians between the ray ending at the origin and
    passing through the point (1,0), and the ray ending at the origin and
    passing through the point (x2, x1). (Note the role reversal: the
    “y-coordinate” is the first function parameter, the “x-coordinate” is
    the second.)

    They take their arguments in opposite order. Thus:

    In [31]: arctan2(cos(deg2rad(sal)), cos(deg2rad(oc))*sin(deg2rad(sal)))
    Out[31]: 0.0041572064598812417
    
    In [32]: arctan2(cos(deg2rad(oc))*sin(deg2rad(sal)), cos(deg2rad(sal)))
    Out[32]: 1.5666391203350154
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.