• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MATH HOMEWORK HELP, LOGS. I've got the basics done. Just don't know the Math.log :)

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
[23/12/2010 01:08:42] [Error - TalkAction Interface]
[23/12/2010 01:08:42] data/talkactions/scripts/mathLogs.lua:onSay
[23/12/2010 01:08:42] Description:
[23/12/2010 01:08:42] data/talkactions/scripts/mathLogs.lua:12: attempt to index global 'Math' (a nil value)
[23/12/2010 01:08:42] stack traceback:
[23/12/2010 01:08:42] data/talkactions/scripts/mathLogs.lua:12: in function <data/talkactions/scripts/mathLogs.lua:2>

Code:
function onSay(cid, words, param, channel) 
-- A^aX+b = B^cX+d --
-- x = (Log B * d) - (Log A * b) / (Log A * a) - (Log B * c) --
-------mathConfig--------
local A = 4
local B = 9
local a = 2
local b = 3
local c = 4
local d = 5
local x = (((Math.LOG10(B)) * d) - ((Math.LOG10(A)) * b) / ((Math.LOG10(A)) * a) - ((Math.LOG10(B)) * c))
-------/mathConfig-------
		if isPlayer(cid) then 
            doCreatureSay(cid, "The Answer to ".. A .."^".. a .."X+".. b .." = ".. B .."^".. c .."X+".. d .." is X = ".. x .."", TALKTYPE_ORANGE_1)
		end 
	return true
end
 
FIXED :)

Code:
function onSay(cid, words, param, channel) 
-- A^aX+b = B^cX+d --
-- x = (Log B * d) - (Log A * b) / (Log A * a) - (Log B * c) --
-------mathConfig--------
local A = 4
local B = 9
local a = 2
local b = 3
local c = 4
local d = 5
local x = (((math.log10(B)) * d) - ((math.log10(A)) * b) / ((math.log10(A)) * a) - ((math.log10(B)) * c))
-------/mathConfig-------
		if isPlayer(cid) then 
            doCreatureSay(cid, "The Answer to ".. A .."^".. a .."X+".. b .." = ".. B .."^".. c .."X+".. d .." is X = ".. x .."", TALKTYPE_ORANGE_1)
		end 
	return true
end
 
B = 9
Log10B = x
B = 10^x
9^1 = 10^x
Log9 = Log10^x
Log9 = xLog10
Log9/Log10 = x
Log9/1(Log10^10 = 1) = x
Log3^2 = x
2Log3 = x//

Logs aren't too hard
 
I know logs arent that hard, I sat in class n after the teacher showed me that u can change exponential equations like that to Logs I ripped off in an algebra way of creating my own formula, so then I wanted to be able to use that formula faster so i can do homework in 2.2 seconds every night xD. woot to epicness :P
 
4^2x+3 = 9^4x+5
Log4^2x+3 = Log9^4x+5
(2x+3)Log4 = (4x+5)Log9
(2 x Log4)x + (3 x Log4) = (4 x Log9)x + (5 x Log9)
(2 x Log4)x - (4 x Log9)x = (5 x Log9) - (3 x Log4)
((2 x Log4)-(4 x Log9))x = (5 x Log9) - (3 x Log4)
x = ( (5 x Log9) - (3 x Log4) / (2 x Log4)-(4 x Log9) )

thats how i found the formula :P
 
Back
Top