acos

Started by
13 comments, last by Tera_Dragon 19 years, 6 months ago
I was just reading through some vetor math, and came across the following formula: O = acos( (a.b)/(||a|| * ||b||) ) Where O is the angle between the two vectors. I was just wondering what acos is. Is it 1/cos (cos to the -1)?
____________________________________________________________Programmers Resource Central
Advertisement
It's the inverse of cos, ie if y = acos(x) then x = cos(y).
Quote:Original post by Anonymous Poster
It's the inverse of cos, ie if y = acos(x) then x = cos(y).


So I was correct then. :p
Thank you.
____________________________________________________________Programmers Resource Central
It's inverse cosine. With numbers the inverse of x is the number y such that y*x=1. With functions the inverse of f is the function g such that g(f(a))=a. So more or less acos(cos(t))=t. More or less because cos(t)=cos(t+2*n*pi) where n is an integer and cos(t)=cos(2*pi-t). So t could be any real number but you are going to get back a number between 0 and pi. So only if 0<=t<=pi does acos(cos(t))=t.
Keys to success: Ability, ambition and opportunity.
Quote:Original post by Tera_Dragon
So I was correct then.
Not to be rude, but just so that you are corrected, no, you weren't correct. acos(x) does not equal (cos(x))-1. acos(x) is often written as cos-1(x), but this is not the same as 1/cos(x).

Basically, if cos(x) takes an angle and returns a ratio of side-adjacent to hypotenuse, then acos(y) takes a ratio of side-adjacent to hypotenuse, and returns an angle.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
acos is not 1/cos. It is a different function as LilBudyWizer said.

y = cos(x)
acos(y) = x

1/cos is the secent function.


1/cos = secant
1/sin = cosecant
1/tan = cotangent

These are not the same as acos, asin, or atan.
Those who dance are considered insane by those who cannot hear the music.
Quote:Original post by Agony
acos(x) is often written as cos-1(x), but this is not the same as 1/cos(x).

Confused...
____________________________________________________________Programmers Resource Central
Let f(x) = cos(x)
Let g(x) = acos(x) = cos-1(x)
Let h(x) = 1/cos(c) = cos(x)-1

You have f(g(x)) = x but f(x)*h(x) = 1

arc cosine is the inverse function of cosine
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote:Original post by Tera_Dragon
Quote:Original post by Agony
acos(x) is often written as cos-1(x), but this is not the same as 1/cos(x).

Confused...


It is confusing notation. I would just take it for granted that when you see cos-1(x) that what it means is acos(x) instead of 1/cos(x). This is simply an oddity of math notation. There are other such oddities out there! You do have to be careful of the context of the equation, since in some cases people will write in a way that is inconsistent with this oddity. Being able to spot the inconsistency is EXACTLY why it is really, really good to understand geometry and trig!

You can see that acos is not the same as 1/cos by looking at this example:

cos(0) is equal to 1
acos(x) is the angle whose cos is x, therefore since cos(0) is 1, we can see that acos(1) is 0

But, 1/cos(0) = 1/1 = 1, which is VERY different from acos(1)!

I hope this helps a bit.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Thank you both. This has cleared things up a bit :D
____________________________________________________________Programmers Resource Central

This topic is closed to new replies.

Advertisement