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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:28:19+00:00 2026-05-15T21:28:19+00:00

What is the opposite of the Math.tan(double x) function of java? I know that

  • 0

What is the opposite of the Math.tan(double x) function of java?

I know that Tan(X) = oppositeSideLength/AdjacentSideLength

but I have the opposite and adjacent sides so I want to do the opposite operation.

ie: x = Tan^-1(oppositeSideLenght/AdjacentSideLength) (that is how I would enter it in a calculator.

I just looked in the Math class and I know that there is:

  • Math.atan(
  • Math.atan2

but I don’t think that either of these is what I am looking for.

  • 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-15T21:28:20+00:00Added an answer on May 15, 2026 at 9:28 pm

    Yes, you do indeed want atan, or sometimes, atan2. The difference between the two is that atan will fail under some circumstances when one of the side lengths are zero. While that may be unlikely for triangles, it is a possibility for some other, more general uses of atan. In addition, the atan function gives you an angle limited to the interval [-pi/2,pi/2]. So if you think about the atan function as a function of two inputs, (x,y), atan(y/x) will yield the same result as atan((-y)/(-x)). This is a serious flaw in some circumstances.

    To solve these problems, the atan2 is defined such that it yields the correct result for all values of x and y, in any quadrant. One would use it as

    atan2(oppositesidelength,adjacentsidelength)
    

    to yield a consistent result.

    Of course, for use in a non-degenerate triangle, the simple call to atan(opposite/adjacent) should be entirely adequate for your purposes.

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

Sidebar

Related Questions

I know that sin is opposite/hypotenuse in a right angled triangle and cos is
This is similar to this question , but kind of the opposite. I have
Is there an exact opposite action to join in linQ to SQL? I want
Note: This is the opposite direction to most similar questions! I have an iPhone
I'm trying to make a method that returns a string of words in opposite
How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly)
I was hoping someone that is good with math and loops could help me
let me begin by stating that's i'm dreadful at math. i'm attempting to reposition
I personally loathe background music on a website. My client has opposite feelings on
I need a function which takes a line (known by its coordinates) and return

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.