I would like how to know how inverse can be used
Could I use it like this?
local i = 0
function Example()
if i > 1 then
i = i:inverse
end
print(i)
end
Example()
I would like how to know how inverse can be used
Could I use it like this?
local i = 0
function Example()
if i > 1 then
i = i:inverse
end
print(i)
end
Example()
"Inverse" is a term from mathematics that has two meanings:
The inverse function of a function "undoes" that function. i.e., if F is the inverse of f, then F(f(x)) should be the same as x. Examples:
*x^2 is the inverse of math.sqrt(x)
math.acos the inverse of math.cosmath.sin the inverse of math.asin.Not all functions are invertible (meaning some functions don't have inverses)
The identity of an operation is the[^1] value that "does nothing" to other values:
+ (for numbers) is 0 since x + 0 is x* (for numbers) is 1 since x * 1 is x* (for CFrames) is CFrame.new(0, 0, 0) since x * CFrame.new() is x+ (for Vector3s) is Vector3.new(0, 0, 0) since x + Vector3.new() is xThe inverse of a value x with respect to an operation is the value y that "cancels" with x yielding the identity of that operation.
Not all values have inverses.
x with respect to + (for numbers) is -x since x + -x is 0, the additive identityx with respect to * (for numbers) is 1/x or x^-1 since x * 1/x is 1, the multiplicative identity. 0 does not have a multiplicative inversex with respect to + (for Vector3s) is -x since x + -x is Vector3.new(0, 0, 0), the additive identityx with respect to * (for CFrames) is x:inverse() since x * x:inverse() is CFrame.new(), the multiplicative identity of CFrames[^1]: identities are unique
As i read in the comments, the thing you want is:
Value = -Value
Your question is about :inverse, wich is a method that can be called on CFrames.
As tested in roblox studio:
v = 2 print(-v), prints -2
v = -2 print(-v), prints 2
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Not exactly; you use the inverse function for CFrames (also known as CoordinateFrames). This article will (hopefully) help you w/ this & steer you in the right direction :) : http://wiki.roblox.com/index.php?title=Understanding_CFrame
No, the point is how do i get the opposite value if -1 is the inverse of 1, such things. I wanna know how to get the Inverse of values
inverse = x * -1