473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Inverse Tan function

Hi

I am having difficulty calculating an angle using VB.NET
I have calculated opposite over adjacent but can not get the angle from this
value.

Example on a calculator:

Tan-1(1.234)=51
Tan-1(1.963)=63
Tan-1(84.5)=89
Tan-1(5.25)=79

Where the number in the brackets is opp/adj.

I have put Tan-1 to rather than just Tan as I beleive it has to be inverse.

However, I can not find a VB function to return the figures given above on
the right.
I have tried using Tan, Atan, Atan2, Tanh but always get figures between -2
and 2-3. I think these may be between -Pi and Pi.

Can anyone suggest a solution to get an angle from opp/adj in VB.NET?

Regards, Carl Gilbert
Nov 21 '05 #1
2 18991
Hi,

Remember that tan and atan angles are in radians not degrees.
Dim angle As Double = 45

Dim ToRadians As Double = System.Math.PI / 180

Dim ToDegrees As Double = 180 / System.Math.PI

Dim n As Double = System.Math.Tan(angle * ToRadians)

Dim a As Double = System.Math.Atan(n)

Trace.WriteLine(a * ToDegrees)

Ken

--------------------------

"Carl Gilbert" <mr*************@hotmail.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
Hi

I am having difficulty calculating an angle using VB.NET
I have calculated opposite over adjacent but can not get the angle from this
value.

Example on a calculator:

Tan-1(1.234)=51
Tan-1(1.963)=63
Tan-1(84.5)=89
Tan-1(5.25)=79

Where the number in the brackets is opp/adj.

I have put Tan-1 to rather than just Tan as I beleive it has to be inverse.

However, I can not find a VB function to return the figures given above on
the right.
I have tried using Tan, Atan, Atan2, Tanh but always get figures between -2
and 2-3. I think these may be between -Pi and Pi.

Can anyone suggest a solution to get an angle from opp/adj in VB.NET?

Regards, Carl Gilbert

Nov 21 '05 #2
Cheers Ken.

I was getting Atan(opp/adj) but I was not multiplying this by (180/Pi)

Works ok now though.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uP*************@TK2MSFTNGP11.phx.gbl...
Hi,

Remember that tan and atan angles are in radians not degrees.
Dim angle As Double = 45

Dim ToRadians As Double = System.Math.PI / 180

Dim ToDegrees As Double = 180 / System.Math.PI

Dim n As Double = System.Math.Tan(angle * ToRadians)

Dim a As Double = System.Math.Atan(n)

Trace.WriteLine(a * ToDegrees)

Ken

--------------------------

"Carl Gilbert" <mr*************@hotmail.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
Hi

I am having difficulty calculating an angle using VB.NET
I have calculated opposite over adjacent but can not get the angle from this value.

Example on a calculator:

Tan-1(1.234)=51
Tan-1(1.963)=63
Tan-1(84.5)=89
Tan-1(5.25)=79

Where the number in the brackets is opp/adj.

I have put Tan-1 to rather than just Tan as I beleive it has to be inverse.
However, I can not find a VB function to return the figures given above on
the right.
I have tried using Tan, Atan, Atan2, Tanh but always get figures between -2 and 2-3. I think these may be between -Pi and Pi.

Can anyone suggest a solution to get an angle from opp/adj in VB.NET?

Regards, Carl Gilbert

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David C. Fox | last post by:
Is there a function which takes a list of tuples and returns a list of lists made up of the first element of each tuple, the second element of each tuple, etc.? In other words, the the inverse...
12
by: Steven Bethard | last post by:
So I know that zip(*) is the inverse of zip(), e.g.: >>> zip(*zip(range(10), range(10))) What's the inverse of izip? Of course, I could use zip(*) or izip(*), e.g.: >>>...
15
by: Jordan Rastrick | last post by:
First, a disclaimer. I am a second year Maths and Computer Science undergraduate, and this is my first time ever on Usenet (I guess I'm part of the http generation). On top of that, I have been...
6
by: vishnu mahendra | last post by:
hello to all, can any one please give me an algorithm to find inverse of a matrix of order n rows and m columns. thank you in advance, vishnu.
9
by: Water Cooler v2 | last post by:
What is the inverse of the sine function? I've been pulling my hair and I have no clue nor memory of how to go about solving this little expression: sine-1 (read sine inverse) of (1-(x/y)) An...
6
by: Randy | last post by:
Hello, Can someone tell me how to derive the Inverse of Math.Log10(value)? Thanks
5
by: Mario | last post by:
How do I get the inverse of a cosine, that is, cos(a) = x, I have x and I need to know a? I don't need the hyperbolic inverse, unless I can use it to get the cosine inverse. Greetings, Mario
2
by: bartsimpson8882002 | last post by:
I was wondering if scipy/numpy has the inverse cumulative normal function, ie the function f in this expression f(scipy.stats.norm.cdf(1.2)) = 1.2 or more generally, a function f which fits...
4
by: Jonathan Fine | last post by:
Hello As part of the MathTran project I found myself wanting to maintain a bijection between long names and short names. http://www.open.ac.uk/mathtran In other words, I wanted to have two...
10
by: Paul McGuire | last post by:
Is there an inverse function to the builtin 'id'? The poster who asked about 1-to-1, 1-to-n, etc. relationships (presumably in CS terms - I hope I didn't misread some porn spam by mistake), got me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.