OK...
inverse: if x=g(f(x)) then g is the inverse of f and visa versa.
f(x)^-1: if 1=f(x)*g(x) then g(x)=1/f(x)=f(x)-1
examples:
f(x) = x^2+7
inverse: x=g(f(x)) find g(x):
x = g(x^2+7) therefor:
g(x)=sqrt(x-7)
f(x)^-1 = 1/f(x) = 1/(x^2+7)=x^-2+1/7
in math, we have the tan function, the cotan function, and the arctan function. cotan = tan(x)^-1. arctan(tan(x))=x. arctan is the inverse. on a calculator =, they use the symbol "tan^-1" for the arctan function. It is not "mathematically" correct.
I hope this helps.
As for your code problem , we will need to see your code to be able to tell you what is wrong with it.
Dwiel
Simple trigonometry problem
March 16, 2003 10:00 PM
quote:
Original post by Tazzel3D
f(x) = x^2+7
inverse: x=g(f(x)) find g(x):
x = g(x^2+7) therefor:
g(x)=sqrt(x-7)
f(x)^-1 = 1/f(x) = 1/(x^2+7)=x^-2+1/7
You totally sure about this? You can''t distribute the division like that...if you want to turn a fraction with a polynomial in the denominator into a sum of fractions, you need to use the process of partial fractions. This can''t be done with 1/(x^2+7), I think...
Plus, for your example, I''ll just note that the inverse of the function f(x)=x^2+7 is actually not a function itself.
quote:
Original post by Anonymous Poster
You totally sure about this? You can''t distribute the division like that...if you want to turn a fraction with a polynomial in the denominator into a sum of fractions, you need to use the process of partial fractions. This can''t be done with 1/(x^2+7), I think...
Plus, for your example, I''ll just note that the inverse of the function f(x)=x^2+7 is actually not a function itself.
sorry bout that... yes, you are correct that it is not a function.. it is two: f(x)=sqrt(x-7) or f(x)=-sqrt(x-7). Also, I was thinking too quickly and am sorry about distributing the polynomial like I did.. that was wrong. Other than that, I believe, everything is correct.
nobodynews:
you can use the method that you suggested... it is basically the same thing... kind of. I was just trying to be more abstract using the def of inverse function as stated in my calc book....
hopefully the confusion is gone now!
Dwiel
March 20, 2003 05:18 PM
quote:
Original post by Tazzel3D
sorry bout that... yes, you are correct that it is not a function.. it is two: f(x)=sqrt(x-7) or f(x)=-sqrt(x-7). Also, I was thinking too quickly and am sorry about distributing the polynomial like I did.. that was wrong. Other than that, I believe, everything is correct.
nobodynews:
you can use the method that you suggested... it is basically the same thing... kind of. I was just trying to be more abstract using the def of inverse function as stated in my calc book....
hopefully the confusion is gone now!
Dwiel
There''s two main ways to define an inverse function(or relation):
Algebraic: if y = f(x), then the inverse is f^-1(x) such that x = g(f(x)), like you said
Geometric: the inverse of a function(or any relation, for that matter) is the reflection of that relation over the line y=x
Something which is annoying but has to be put up with: f^-1(x) means inverse function, while according to the rules of algebra f(x)^-1 is 1/f(x).
Another note: If you know the derivative(dy/dx) of a function, the derivative of the inverse function is 1/(dy/dx).
CyberGhost,
It is really easy. If you know the triangle you are over, then just interpolate the y value between the vertices to get the height of the ground and add your height over the ground:
It is really easy. If you know the triangle you are over, then just interpolate the y value between the vertices to get the height of the ground and add your height over the ground:
// This assumes that the verts on on a grid, otherwise// the math is more complicated.// verts are v0, v1, v2.// v0v1 is parallel the the Z axis.// v0v2 is parallel to the X axis.// your position is x,z// your height over the ground is h y = v0.y; y += ( x - v0.x ) / ( v1.x - v0.x ) * ( v1.y - v0.y ); y += ( z - v0.z ) / ( v2.z - v0.z ) * ( v2.y - y0.y ); y += h;
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Yea that sounds kewl,
And I even understand it, guess I'm not as thick as I thought
Just need to check sommat tho.
As you know each cell in the vertice matrix consists of 4 vertices, in which they construct two triangles.
Looking at da vertices placement for your example I guess your talking about the left triangle,
However what would I do if I am working with the right triangle.
Does vertices order mater, as long as i keep v0v2 parallel to the x coordinate and v0v1 parallel to the z coordinate.
Would the following work or am I miss understanding something:
Is there anything I must do to the calculation for the right triangle, such as change the order of the vertices.
I hope I havent confused everyone to much, this is my first time I have done any collision detection n finding it hard to get started as there seems to be lack of tuts on the subject which are writtern in English instead of Maths.
Thanx
[edited by - CyberGhost on March 21, 2003 5:04:51 AM]
And I even understand it, guess I'm not as thick as I thought

Just need to check sommat tho.
As you know each cell in the vertice matrix consists of 4 vertices, in which they construct two triangles.
Looking at da vertices placement for your example I guess your talking about the left triangle,
However what would I do if I am working with the right triangle.
Does vertices order mater, as long as i keep v0v2 parallel to the x coordinate and v0v1 parallel to the z coordinate.
Would the following work or am I miss understanding something:
v1---------v0| \ || \ || \ || \ || \|v0---------v2
Is there anything I must do to the calculation for the right triangle, such as change the order of the vertices.
I hope I havent confused everyone to much, this is my first time I have done any collision detection n finding it hard to get started as there seems to be lack of tuts on the subject which are writtern in English instead of Maths.
Thanx
[edited by - CyberGhost on March 21, 2003 5:04:51 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement