question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Math.Tan as way off

See original GitHub issue

Area of Cosmos - What area of Cosmos are we dealing with?

System.math

Expected Behaviour - What do you think that should happen?

The equation I put in should be equal to 72.9467445271450862

Actual Behaviour - What unexpectedly happens?

It returns the value of 1.000001

Reproduction - How did you get this error to appear?

Run 1 / Math.Tan(90 * 0.5f / 180.0f * 3.14159f);

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

Devkit

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ascpixicommented, May 22, 2022

Could it be that android calculator and microsoft math be using degrees and not radians?

yep, Math.Tan is correct here, 1 / Math.Tan((90 * 0.5f / 180.0f * 3.14159f) * (Math.PI / 180)) (run) returns the expected value of 72.94674177739903, as it operates on radians, not degrees

0reactions
quajakcommented, May 20, 2022

The minor differences between mathway, cosmos and c# windows I would ignore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Math.tan() - JavaScript - MDN Web Docs
The Math.tan() static method returns the tangent of a number in radians.
Read more >
Tangent Function
The tangent function is a periodic function which is very important in trigonometry. The simplest way to understand the tangent function is to...
Read more >
What could cause the Math.tan to not work? [duplicate]
The argument to Math.tan is an angle in radians. (This is mentioned in the Javadoc for that method.) You're giving it an angle...
Read more >
Tan 90 Degrees (Exact Value & How to Find Tangent 90)
The value of tan 90 degrees is undefined. The tangent of an angle is equal to the ratio of sine and cosine of...
Read more >
How to Graph Tangent (Simplified) - YouTube
Learn how to graph the tangent graph in this free math video tutorial by Mario's Math Tutoring. We go through a simple and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found