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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:54:45+00:00 2026-05-27T20:54:45+00:00

My python interpreter is acting funky when I use the math.cos() and math.sin() function.

  • 0

My python interpreter is acting funky when I use the math.cos() and math.sin() function. For example, if I do this on my calculator:

cos(35)*15+9 = 21.28728066
sin(35)*15+9 = 17.60364655

But when I do this on python (both 3.2 and 2.7)

>>> import math
>>> math.cos(35)*15+9
-4.5553830763726015

>>> import math
>>> math.sin(35)*15+9
2.577259957557734

Why does this happen?

EDIT: How do you change the Radian in Python to degrees, just in case?

  • 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-27T20:54:45+00:00Added an answer on May 27, 2026 at 8:54 pm

    This is being caused by the fact that you are using degrees
    and the trigonometric functions expect radians as input:
    sin(radians)

    The description for sin is:

    sin(x)
        Return the sine of x (measured in radians).
    

    In Python, you can convert degrees to radians with the math.radians function.

    So if you do this with your input:

    >>> math.sin(math.radians(35)) * 15 + 9
    17.60364654526569
    

    it gives the same result as your calculator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I updated my python interpreter, but I think the old one is still called.
I have a python Interpreter written in C++, the PyRun_String function from the Python
I setup PyDev with this path for the python interpreter /System/Library/Frameworks/Python.framework/Versions/2.5/Python since the one
I'm looking at moving a program that currently embeds a Python interpreter to use
I often use the python interpreter for doing quick numerical calculations and would like
I came across this in the Python interpreter source code. void PyThread_delete_key_value(int key) {
If you open a Python interpreter, and type import this, as you know, it
I'm getting a strange error from the Python interpreter when I run this code:
What is the procedure to get IPython to use IronPython as it's Python interpreter?
Many times I will use the Python interpreter to inspect variables and step through

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.