Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- function signFix(eq)
- if eq == math.abs(eq) then
- return "+"..eq
- else
- return eq
- end
- end
- tArgs[2] = tArgs[2]/tArgs[1]
- tArgs[3] = tArgs[3]/tArgs[1]
- tArgs[4] = tArgs[4]/tArgs[1]
- print("x^2 "..signFix(tArgs[2]).."x "..signFix(tArgs[3]).." = "..tArgs[4])
- print("x^2 "..signFix(tArgs[2]).."x "..signFix(((tArgs[2]/2)^2)).." = "..((tArgs[4]-tArgs[3])+((tArgs[2]/2))^2))
- print("(x "..signFix((tArgs[2]/2))..")^2 = "..((tArgs[4]-tArgs[3])+((tArgs[2]/2))^2))
- print("x "..signFix((tArgs[2]/2)).." = "..((tArgs[4]-tArgs[3])+((tArgs[2]/2))^2)^0.5)
- print("x = "..(0-(tArgs[2]/2)+((tArgs[4]-tArgs[3])+((tArgs[2]/2))^2)^0.5).." or "..(0-(tArgs[2]/2)-((tArgs[4]-tArgs[3])+((tArgs[2]/2))^2)^0.5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement