The “→” symbol, used to store values to a variable, is typed with the sto→ key. We will save the two values to variables D and E. Next you need to calculate the values of x using the quadratic equation. So far, the programs clears the screen, then prompts the user for three values, which it saves to variables A, B, and C. Coding the Programīegin with the program by clearing the home screen and adding inputs for the three coefficients. A helpful tip is to add an “A” to the front (“AQUAD” for example) so that the program is always near the top of your program list since they are sorted alphabetically. I’ll name it “QUAD” here because it solves the quadratic formula. That way you can easily recognize it and understand what it does from the title. You can name the program whatever you like, but its recommended that the name relate to the program’s function. To create a program, press the prgm button and scroll over to NEW. Jump to Complete Code! Creating a Program Text("(".v1."x".v2.") (".v3."x".v4.Ever wanted to easily solve or factor quadratic equations without having to write out the formula and calculate manually? This detailed tutorial will show you how to program the quadratic formula into your TI-84 calculator so that all you need to do it type in the coefficient values! Start reading below for specific instructions, or press the button to jump directly to the complete code if you already know what you’re doing. Text("No solution found.",WIDTH/2,HEIGHT/2) Tap a box and input the values then tap Solve. If touch.x>.x/2-shift.x and touch.y>.y/2-shift.y and -self.w/2 and t./2 and t.y<+self.h/2 then If unter then unter = unter + DeltaTime end Self.lineCapMode=args.lineCapMode or ROUND Self.stroke=args.stroke or color(0, 0, 0, 255) =string.sub(s,math.ceil(string.len(s)/2)+1,string.len(s)) then If string.sub(s,1+string.len(m),math.ceil(string.len(s)/2)) If lo~=0 then s=s.space.stringSign(lo).space.tostring(math.floor(math.abs(lo))).")" end If li~=1 then s=s.tostring(math.floor(li)) end If fi~=0 then s=s.space.stringSign(fi).space.tostring(math.floor(math.abs(fi))).")" end If fo~=1 then s=s.tostring(math.floor(fo)) end Table.insert(factors,math.floor(i*sign(a)))įor i,v in pairs(math.findAllFactors(a)) doįor n,m in pairs(math.findAllFactors(b)) doįunction getFactoredString(fo,fi,li,lo,m) If factorButton then factorButton.pos=vec2(WIDTH/2,HEIGHT/8) end Local m=math.abs(eatestCommonFactor(mm,c))Ī=function(a)if a=s then If math.floor(m.counter*25)%2=0 then m.func(BEGAN) end Text("Modify the variables, then click factor to factor the formula.",WIDTH/2,HEIGHT-100) If bpos then varb=math.abs(varb) else varb=-math.abs(varb)end If cpos then varc=math.abs(varc) else varc=-math.abs(varc)end Here is what I have: - FactorĭrawFactors = I'm confused with changing the loop to 2, math.sqrt(ac) and what to do inside, so I left it for later. So I added pseudo code to clarify parts and added some aesthetic (not much) to the program. Is there a way to have pairs with a single variable like i? So if the input was 10, the output (print and/or text) should read 1 10, 2 5. I'm trying to do for i,v in pairs(factorsList) do print(i,v) end but v doesn't have any value. Also, in the print command, I want to have it in pairs. I would like to draw the factors in a list format (with commas and such), however, they are overlapping each other. This is just the beginning of a big project I have in mind. If you know how to factor, this basically will be part of the "x-box" method. Firstly, though, I have created a program that finds the factors of the inputted number. I'm attempting to code a program that will factor polynomials.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |