Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Factoring quadratic equations
New Posts  All Forums:Forum Nav:

Factoring quadratic equations

post #1 of 5
Thread Starter 
How would i factor out a quadratic equation so that this happened using javascript?

ax^2+bx+c

i want to factor this to

(qx + n)(gx + v)

I know how to get the zeros, but I want to find the factored form.

Any ideas?

Thanks
post #2 of 5
r1 = (-b + sqrt(b^2-4ac))/2a

r2 = (-b - sqrt(b^2-4ac))/2a

(x-r1)(x-r2)
Edited by serge2k - 3/10/11 at 1:10am
    
CPUMotherboardOSMonitor
2500k P8P67 Windows 7 Ultimate x64 22" phillips 
KeyboardPowerMouseMouse Pad
Cheap Logitech Antec Earthwatts 650W Razer Deathadder Razer eXactMat 
  hide details  
Reply
    
CPUMotherboardOSMonitor
2500k P8P67 Windows 7 Ultimate x64 22" phillips 
KeyboardPowerMouseMouse Pad
Cheap Logitech Antec Earthwatts 650W Razer Deathadder Razer eXactMat 
  hide details  
Reply
post #3 of 5
before you do that check that b^2-4ac is positive, I'm pretty sure(positive) javascript isn't going to natively handle complex variables.
Lappy 3001
(13 items)
 
  
CPUMotherboardGraphicsRAM
i3-560 @ 3.85 GHz ASRock H55M-LE PNY XLR8 GTX 460 4G Corsair XMS3 DDR3 @ 1600 MHz 
OSMonitorPowerCase
Windows 7 / Ubuntu Samsun SyncMaster 226bw 22" Corsair CX600 Cooler Master HAF 932 
  hide details  
Reply
Lappy 3001
(13 items)
 
  
CPUMotherboardGraphicsRAM
i3-560 @ 3.85 GHz ASRock H55M-LE PNY XLR8 GTX 460 4G Corsair XMS3 DDR3 @ 1600 MHz 
OSMonitorPowerCase
Windows 7 / Ubuntu Samsun SyncMaster 226bw 22" Corsair CX600 Cooler Master HAF 932 
  hide details  
Reply
post #4 of 5
probably not, never mind.
Edited by badatgames18 - 3/15/11 at 8:37am
Galbus
(21 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K 8M Skylake Quad-Core 4.0 G... ASUS ROG MAXIMUS VIII EXTREME LGA 1151 Intel Z1... 3x MSI GeForce GTX 1080 Founders Edition  2x [Trident Z] F4-3600C16D-16GTZKW 16-16-16-36... 
Hard DriveHard DriveOptical DriveOptical Drive
Plextor M8Pe AIC 1TB PCI-Express 3.0 x4 MLC Int... Plextor M8Pe AIC 1TB PCI-Express 3.0 x4 MLC Int... LG BH16NS40 Blu-ray Card Reader: Rosewill RDCR-11003 - 3.5" 74-in-1... 
CoolingOSMonitorKeyboard
Custom Ultra cool passive heatsink Microsoft Windows 10 Pro 64-bit ViewSonic XG2703-GS Black 27" 4ms (GTG) IPS G-S... Das Keyboard 4 Professional Mechanical Keyboard 
PowerCaseMouseMouse Pad
CORSAIR AXi Series AX1500i Digital 1500W 80 PLU... Corsair Obsidian 750D Black Aluminum / Steel AT... Logitech G900 Chaos Spectrum Logitech 
AudioOtherOtherOther
onboard Canon i-SENSYS LBP7680Cx (5089B014) Duplex 9600... Canon imageFORMULA DR-F120 (9017B002) 600 dpi U... Brother Personal Plain Paper Fax Machine, FAX-575 
  hide details  
Reply
Galbus
(21 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K 8M Skylake Quad-Core 4.0 G... ASUS ROG MAXIMUS VIII EXTREME LGA 1151 Intel Z1... 3x MSI GeForce GTX 1080 Founders Edition  2x [Trident Z] F4-3600C16D-16GTZKW 16-16-16-36... 
Hard DriveHard DriveOptical DriveOptical Drive
Plextor M8Pe AIC 1TB PCI-Express 3.0 x4 MLC Int... Plextor M8Pe AIC 1TB PCI-Express 3.0 x4 MLC Int... LG BH16NS40 Blu-ray Card Reader: Rosewill RDCR-11003 - 3.5" 74-in-1... 
CoolingOSMonitorKeyboard
Custom Ultra cool passive heatsink Microsoft Windows 10 Pro 64-bit ViewSonic XG2703-GS Black 27" 4ms (GTG) IPS G-S... Das Keyboard 4 Professional Mechanical Keyboard 
PowerCaseMouseMouse Pad
CORSAIR AXi Series AX1500i Digital 1500W 80 PLU... Corsair Obsidian 750D Black Aluminum / Steel AT... Logitech G900 Chaos Spectrum Logitech 
AudioOtherOtherOther
onboard Canon i-SENSYS LBP7680Cx (5089B014) Duplex 9600... Canon imageFORMULA DR-F120 (9017B002) 600 dpi U... Brother Personal Plain Paper Fax Machine, FAX-575 
  hide details  
Reply
post #5 of 5
Thread Starter 
Almost done.

http://wdroom.com/factor.html

Just need to deal with imaginary numbers
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Factoring quadratic equations